summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-02-01 22:33:15 +0100
committerLennart Poettering <lennart@poettering.net>2012-02-01 22:33:15 +0100
commit5d6b158473100a7a85e790f8ead0b826baa13b5e (patch)
treeb85b3165d677dcccb639b6678023206edce2fdc3 /src/main.c
parenta6927d7ffc18c51fbb9940f5f1e89f5c7695ed63 (diff)
exec: include path name of binary we are about to execute when renaming forked off processes
Immediately after forking off a process change the comm name and argv[0] to "(foobar)" where "foobar" is the basename of the path we are about to execute. This should be useful when charting boot progress.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 94e6ec63cc..738db6c264 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1138,7 +1138,7 @@ int main(int argc, char *argv[]) {
bool reexecute = false;
const char *shutdown_verb = NULL;
dual_timestamp initrd_timestamp = { 0ULL, 0ULL };
- char systemd[] = "systemd";
+ static char systemd[] = "systemd";
bool is_reexec = false;
int j;
bool loaded_policy = false;
@@ -1169,9 +1169,9 @@ int main(int argc, char *argv[]) {
called 'init'. After a subsequent reexecution we are then
called 'systemd'. That is confusing, hence let's call us
systemd right-away. */
-
program_invocation_short_name = systemd;
prctl(PR_SET_NAME, systemd);
+
saved_argv = argv;
saved_argc = argc;