diff options
author | Thomas Haller <thaller@redhat.com> | 2015-03-15 16:00:36 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-20 11:43:30 +0100 |
commit | 7fe0f349ce49500871befc7f00cac59139809fae (patch) | |
tree | 40c101288aab23b3733a08bca508f7ffec5971f2 | |
parent | 49cfe6487492dd69a16f8120b22841d39cb92f2b (diff) | |
download | NetworkManager-7fe0f349ce49500871befc7f00cac59139809fae.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 420e56952b..ef4438c54a 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); |