diff options
author | Thomas Haller <thaller@redhat.com> | 2015-03-15 15:59:02 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-03-20 11:43:30 +0100 |
commit | 49cfe6487492dd69a16f8120b22841d39cb92f2b (patch) | |
tree | db00474b93dba2e951977391cfc70e096b2ca108 /src/main.c | |
parent | f64c79afda1006bbe6f569883b37721c3d0f14d5 (diff) | |
download | NetworkManager-49cfe6487492dd69a16f8120b22841d39cb92f2b.tar.gz |
main: (order) earlier create rundir
Create the rundir earlier and before setting up nm-logging.
nm_main_utils_ensure_rundir() errors out with fprintf(stderr)
and does not need nm-logging.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c index 35c7b4e3b0..420e56952b 100644 --- a/src/main.c +++ b/src/main.c @@ -287,6 +287,14 @@ main (int argc, char *argv[]) nm_main_utils_ensure_not_running_pidfile (global_opt.pidfile); + /* Ensure state directory exists */ + if (g_mkdir_with_parents (NMSTATEDIR, 0755) != 0) { + fprintf (stderr, "Cannot create '%s': %s", NMSTATEDIR, strerror (errno)); + exit (1); + } + + nm_main_utils_ensure_rundir (); + if (!nm_logging_setup (global_opt.opt_log_level, global_opt.opt_log_domains, &bad_domains, @@ -326,14 +334,6 @@ main (int argc, char *argv[]) g_free (path); } - /* Ensure state directory exists */ - if (g_mkdir_with_parents (NMSTATEDIR, 0755) != 0) { - nm_log_err (LOGD_CORE, "Cannot create '%s': %s", NMSTATEDIR, strerror (errno)); - exit (1); - } - - nm_main_utils_ensure_rundir (); - /* Read the config file and CLI overrides */ config = nm_config_setup (config_cli, &error); nm_config_cmd_line_options_free (config_cli); |