diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-06-05 11:24:17 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-06-11 13:05:24 +0300 |
commit | c3251f7178687dc0144720f4ca648339f1960635 (patch) | |
tree | 0cf4998d4af60ef93786273dc0544196c0c860ff | |
parent | 0c4159770e177475cb222770f03e0d0ff034f136 (diff) | |
download | connman-c3251f7178687dc0144720f4ca648339f1960635.tar.gz connman-c3251f7178687dc0144720f4ca648339f1960635.tar.bz2 connman-c3251f7178687dc0144720f4ca648339f1960635.zip |
config: No service removal on cleanup
We must not remove the services when connman is stopped.
-rw-r--r-- | src/config.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index 6af979d8..b304645d 100644 --- a/src/config.c +++ b/src/config.c @@ -68,6 +68,7 @@ static int inotify_wd = -1; static GIOChannel *inotify_channel = NULL; static uint inotify_watch = 0; +static connman_bool_t cleanup = FALSE; #define INTERNAL_CONFIG_PREFIX "__internal" @@ -133,6 +134,9 @@ static void unregister_service(gpointer data) char *service_id; GSList *list; + if (cleanup == TRUE) + goto free_only; + connman_info("Removing service configuration %s", config_service->ident); @@ -154,6 +158,7 @@ static void unregister_service(gpointer data) service_id); } +free_only: g_free(config_service->ident); g_free(config_service->type); g_free(config_service->name); @@ -712,10 +717,14 @@ void __connman_config_cleanup(void) { DBG(""); + cleanup = TRUE; + remove_watch(); g_hash_table_destroy(config_table); config_table = NULL; + + cleanup = FALSE; } static char *config_pem_fsid(const char *pem_file) |