diff options
author | Thomas Haller <thaller@redhat.com> | 2015-03-15 16:00:36 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-19 16:29:56 +0100 |
commit | c2b2ffe6b9a378deaa236d6223596fd5b7b9b19b (patch) | |
tree | a8ec7aeb4c57b4abe666029b484948eb8acf4ad0 | |
parent | 1f5723997aecadef4ebef5aa68a1312435e41fd6 (diff) | |
download | NetworkManager-c2b2ffe6b9a378deaa236d6223596fd5b7b9b19b.tar.gz |
main: (order) move run_from_build_dir check before setting up logging
Or: move setup of nm-logging immediately after it is really needed:
before setup of config.
-rw-r--r-- | src/main.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main.c b/src/main.c index 73cb7acead..9d257a2408 100644 --- a/src/main.c +++ b/src/main.c @@ -295,21 +295,6 @@ main (int argc, char *argv[]) nm_main_utils_ensure_rundir (); - if (!nm_logging_setup (global_opt.opt_log_level, - global_opt.opt_log_domains, - &bad_domains, - &error)) { - fprintf (stderr, - _("%s. Please use --help to see a list of valid options.\n"), - error->message); - exit (1); - } else if (bad_domains) { - fprintf (stderr, - _("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"), - bad_domains); - g_clear_pointer (&bad_domains, g_free); - } - /* When running from the build directory, determine our build directory * base and set helper paths in the build tree */ if (global_opt.run_from_build_dir) { @@ -334,6 +319,21 @@ main (int argc, char *argv[]) g_free (path); } + if (!nm_logging_setup (global_opt.opt_log_level, + global_opt.opt_log_domains, + &bad_domains, + &error)) { + fprintf (stderr, + _("%s. Please use --help to see a list of valid options.\n"), + error->message); + exit (1); + } else if (bad_domains) { + fprintf (stderr, + _("Ignoring unrecognized log domain(s) '%s' passed on command line.\n"), + bad_domains); + g_clear_pointer (&bad_domains, g_free); + } + /* Read the config file and CLI overrides */ config = nm_config_setup (config_cli, &error); nm_config_cmd_line_options_free (config_cli); |