diff options
author | Thomas Haller <thaller@redhat.com> | 2015-03-13 23:28:13 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-20 11:43:30 +0100 |
commit | 7be9024c826f524a1383bb6fd1264a1f9247b1d1 (patch) | |
tree | b9c1972d4eb3b16f707e747d2647a8864c2d45e2 /src/main.c | |
parent | af2b44cb43ecdd7d2ad0dcaf930f2674701a5d15 (diff) | |
download | NetworkManager-7be9024c826f524a1383bb6fd1264a1f9247b1d1.tar.gz |
main: (order) parse state file later and use nm-logging
Parse the state file a bit later after daemonizing and setting up
logging. That way, we can use nm-logging.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c index 067a0cee3c..8bfc05c681 100644 --- a/src/main.c +++ b/src/main.c @@ -366,16 +366,6 @@ main (int argc, char *argv[]) } } - /* Parse the state file */ - if (!parse_state_file (global_opt.state_file, &net_enabled, &wifi_enabled, &wwan_enabled, &wimax_enabled, &error)) { - fprintf (stderr, _("State file %s parsing failed: (%d) %s\n"), - global_opt.state_file, - error ? error->code : -1, - (error && error->message) ? error->message : _("unknown")); - /* Not a hard failure */ - } - g_clear_error (&error); - if (global_opt.become_daemon && !global_opt.debug) { if (daemon (0, 0) < 0) { int saved_errno; @@ -394,6 +384,16 @@ main (int argc, char *argv[]) nm_logging_syslog_openlog (global_opt.debug); + /* Parse the state file */ + if (!parse_state_file (global_opt.state_file, &net_enabled, &wifi_enabled, &wwan_enabled, &wimax_enabled, &error)) { + nm_log_err (LOGD_CORE, "State file %s parsing failed: (%d) %s", + global_opt.state_file, + error ? error->code : -1, + (error && error->message) ? error->message : _("unknown")); + /* Not a hard failure */ + } + g_clear_error (&error); + dbus_threads_init_default (); /* Ensure that non-exported properties don't leak out, and that the |