Am 07.11.2010 um 16:44 schrieb John Morrissey:
Linux seems to maintain the length of the original args, even when
the new
args are shorter and NULL-terminated, so the trailing whitespace in
ps(1)
output is probably unavoidable. I've seen the same result with other
daemons
that overwrite argv.
Signed-off-by: John Morrissey <j...@horde.net>
---
diff --git a/os-posix.c b/os-posix.c
index 38c29d1..3ddf7e8 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -149,20 +145,24 @@ char *os_find_datadir(const char *argv0)
#undef SHARE_SUFFIX
#undef BUILD_SUFFIX
-void os_set_proc_name(const char *s)
+void os_set_proc_name(int argc, char **argv, const char *name)
{
-#if defined(PR_SET_NAME)
- char name[16];
- if (!s)
+#ifdef CONFIG_LINUX
Is PR_SET_NAME defined outside Linux? If so, then your patch removes
the limited functionality for those platforms completely.
Andreas