From 1713d3791baa12a757f1e98274cb793111d2b95b Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 13 Jan 2012 16:50:51 -0600 Subject: [PATCH] core: use default config file path if none was found or given on the command-line --- src/nm-config.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nm-config.c b/src/nm-config.c index 71f67d55d0..a19d9d953b 100644 --- a/src/nm-config.c +++ b/src/nm-config.c @@ -224,6 +224,15 @@ nm_config_new (const char *cli_config_path, return NULL; } + /* If for some reason no config file exists, and NM wasn't given on on + * the command line, just use the default config file path. + */ + if (config->path == NULL) { + config->path = g_strdup (NM_DEFAULT_SYSTEM_CONF_FILE); + fprintf (stderr, "No config file found or given; using %s\n", + NM_DEFAULT_SYSTEM_CONF_FILE); + } + /* ignore error if config file not found */ g_clear_error (&local); return config;