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.
Keeps the call to prctl(), since some tools get
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
---
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
Hi,
On Sunday, November 07, 2010 16:44:12 John Morrissey wrote:
-if (prctl(PR_SET_NAME, name)) {
-perror(unable to change process name);
-exit(1);
-}
+
+last_argv_byte = argv[argc - 1] + strlen(argv[argc - 1]);
+
+len = snprintf(argv[0], last_argv_byte -