From 314b062efc5961bc3743df484a5cea9e7e62181f Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 7 Feb 2014 21:06:13 +0000 Subject: We'll get a SIGCHLD so no need to double-fork --- sinit.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sinit.c b/sinit.c index c881fe0..bfa655f 100644 --- a/sinit.c +++ b/sinit.c @@ -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); } -- cgit v1.2.3-70-g09d2