diff options
author | sin <sin@2f30.org> | 2014-02-07 21:06:13 +0000 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-02-07 21:06:29 +0000 |
commit | 314b062efc5961bc3743df484a5cea9e7e62181f (patch) | |
tree | d48d2a75774719b46c68b7b8c2b3daf1f8717a1e | |
parent | 11333316755b558ba963ad7b8a6b169f762fadfa (diff) |
We'll get a SIGCHLD so no need to double-fork
-rw-r--r-- | sinit.c | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -113,7 +113,6 @@ sigreboot(void) static void spawn(const Arg *arg) { - int status; pid_t pid; char *const *p = arg->v; @@ -121,16 +120,10 @@ spawn(const Arg *arg) if (pid < 0) { weprintf("sinit: fork:"); } else if (pid == 0) { - pid = fork(); - if (pid < 0) - weprintf("sinit: fork:"); - else if (pid > 0) - exit(0); setsid(); setpgid(0, 0); execvp(*p, p); weprintf("sinit: execvp %s:", p); _exit(errno == ENOENT ? 127 : 126); } - waitpid(pid, &status, 0); } |