diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-04-12 14:30:50 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-04-17 13:36:50 +0300 |
commit | 6cf81b0652496e6a0f2ef34207f333ec2bedf52a (patch) | |
tree | 10f6b486b1400a43decea637166ec2b2b17ad0f3 /src/config.c | |
parent | 7264f06490a2baf71803e7b8a81d555b7938d814 (diff) | |
download | connman-6cf81b0652496e6a0f2ef34207f333ec2bedf52a.tar.gz connman-6cf81b0652496e6a0f2ef34207f333ec2bedf52a.tar.bz2 connman-6cf81b0652496e6a0f2ef34207f333ec2bedf52a.zip |
config: Warn user if no configuration is found
This is useful so that user gets information that he needs to
fix the config file.
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/config.c b/src/config.c index db152283..9b98f71d 100644 --- a/src/config.c +++ b/src/config.c @@ -378,7 +378,7 @@ static int load_config(struct connman_config *config) gsize length; char **groups; char *str; - gboolean protected; + gboolean protected, found = FALSE; int i; DBG("config %p", config); @@ -412,10 +412,17 @@ static int load_config(struct connman_config *config) groups = g_key_file_get_groups(keyfile, &length); for (i = 0; groups[i] != NULL; i++) { - if (g_str_has_prefix(groups[i], "service_") == TRUE) - load_service(keyfile, groups[i], config); + if (g_str_has_prefix(groups[i], "service_") == TRUE) { + if (load_service(keyfile, groups[i], config) == 0) + found = TRUE; + } } + if (found == FALSE) + connman_warn("Config file %s/%s.config does not contain any " + "configuration that can be provisioned!", + STORAGEDIR, config->ident); + g_strfreev(groups); g_key_file_free(keyfile); |