aboutsummaryrefslogtreecommitdiff
path: root/os-posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'os-posix.c')
-rw-r--r--os-posix.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/os-posix.c b/os-posix.c
index 79fa2288e..488e48005 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -148,8 +148,7 @@ void os_set_proc_name(const char *s)
char name[16];
if (!s)
return;
- name[sizeof(name) - 1] = 0;
- strncpy(name, s, sizeof(name));
+ pstrcpy(name, sizeof(name), s);
/* Could rewrite argv[0] too, but that's a bit more complicated.
This simple way is enough for `top'. */
if (prctl(PR_SET_NAME, name)) {
@@ -194,7 +193,6 @@ void os_parse_cmd_args(int index, const char *optarg)
break;
#endif
}
- return;
}
static void change_process_uid(void)
@@ -360,3 +358,8 @@ int qemu_create_pidfile(const char *filename)
/* keep pidfile open & locked forever */
return 0;
}
+
+bool is_daemonized(void)
+{
+ return daemonize;
+}