Merge "Fix svace 'UNREACHABLE_CODE.NO_PATH' warnings" into tizen
[platform/upstream/connman.git] / vpn / vpn-config.c
index a5be332..2fe0307 100755 (executable)
@@ -275,9 +275,6 @@ static int load_provider(GKeyFile *keyfile, const char *group,
        config_provider->config_entry = g_strdup_printf("provider_%s",
                                                config_provider->ident);
 
-       g_hash_table_insert(config->provider_table,
-                               config_provider->ident, config_provider);
-
        err = __vpn_provider_create_from_config(
                                        config_provider->setting_strings,
                                        config_provider->config_ident,
@@ -288,6 +285,10 @@ static int load_provider(GKeyFile *keyfile, const char *group,
                goto err;
        }
 
+       g_hash_table_insert(config->provider_table, config_provider->ident,
+                               config_provider);
+
+
        connman_info("Added provider configuration %s",
                                                config_provider->ident);
        return 0;
@@ -498,12 +499,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();