If a file is moved to or from a config directory, IN_DELETE and
IN_MODIFY events are not fired, so IN_MOVED_FROM and IN_MOVED_TO
events have to be monitored.
---
 vpn/vpn-config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vpn/vpn-config.c b/vpn/vpn-config.c
index 293c64e..c88a99a 100644
--- a/vpn/vpn-config.c
+++ b/vpn/vpn-config.c
@@ -484,12 +484,12 @@ static void config_notify_handler(struct inotify_event 
*event,
        if (event->mask & IN_CREATE)
                return;
 
-       if (event->mask & IN_DELETE) {
+       if (event->mask & (IN_DELETE | IN_MOVED_FROM)) {
                g_hash_table_remove(config_table, ident);
                return;
        }
 
-       if (event->mask & IN_MODIFY) {
+       if (event->mask & (IN_MODIFY | IN_MOVED_TO)) {
                struct vpn_config *config;
                char *path = get_dir();
 
-- 
2.1.0

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to