summaryrefslogtreecommitdiff
path: root/src/main-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main-utils.c')
-rw-r--r--src/main-utils.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main-utils.c b/src/main-utils.c
index 5a470fa0de..4daa0eef52 100644
--- a/src/main-utils.c
+++ b/src/main-utils.c
@@ -108,6 +108,16 @@ nm_main_utils_write_pidfile (const char *pidfile)
return success;
}
+void
+nm_main_utils_ensure_rundir ()
+{
+ /* Setup runtime directory */
+ if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) {
+ fprintf (stderr, _("Cannot create '%s': %s"), NMRUNDIR, strerror (errno));
+ exit (1);
+ }
+}
+
/**
* nm_main_utils_check_pidfile:
* @pidfile: the pid file
@@ -129,12 +139,6 @@ nm_main_utils_check_pidfile (const char *pidfile, const char *name)
gboolean nm_running = FALSE;
const char *process_name;
- /* Setup runtime directory */
- if (g_mkdir_with_parents (NMRUNDIR, 0755) != 0) {
- nm_log_err (LOGD_CORE, "Cannot create '%s': %s", NMRUNDIR, strerror (errno));
- exit (1);
- }
-
if (!g_file_get_contents (pidfile, &contents, &len, NULL))
return FALSE;