main: Be quiet when config file isn't found
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Tue, 21 Jun 2011 16:42:39 +0000 (13:42 -0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 27 Jun 2011 14:15:08 +0000 (16:15 +0200)
It's ok to run ConnMann without a configuration file, so don't print an
error message when this happens.

src/main.c

index 0f96d6c..bb08e40 100644 (file)
@@ -57,7 +57,11 @@ static GKeyFile *load_config(const char *file)
        g_key_file_set_list_separator(keyfile, ',');
 
        if (!g_key_file_load_from_file(keyfile, file, 0, &err)) {
-               connman_error("Parsing %s failed: %s", file, err->message);
+               if (err->code != G_FILE_ERROR_NOENT) {
+                       connman_error("Parsing %s failed: %s", file,
+                                                               err->message);
+               }
+
                g_error_free(err);
                g_key_file_free(keyfile);
                return NULL;