summaryrefslogtreecommitdiff
path: root/runit/runsv.c
diff options
context:
space:
mode:
authorDenis Vlasenko2009-02-26 12:29:59 +0000
committerDenis Vlasenko2009-02-26 12:29:59 +0000
commitf09f4e015bffe6db5d7e63d47b23f22db4806736 (patch)
tree38393e9a60430aa64541370c68151101e62a64ec /runit/runsv.c
parent48637e0924dcd13629ebf3aeffa80cdda1beb5af (diff)
downloadbusybox-f09f4e015bffe6db5d7e63d47b23f22db4806736.zip
busybox-f09f4e015bffe6db5d7e63d47b23f22db4806736.tar.gz
runsv: small optimization
*: more paranoia around passing NULL to execl[e] function old new delta custom 240 221 -19
Diffstat (limited to 'runit/runsv.c')
-rw-r--r--runit/runsv.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/runit/runsv.c b/runit/runsv.c
index f83d582..4155b8f 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -251,7 +251,6 @@ static unsigned custom(struct svdir *s, char c)
int w;
char a[10];
struct stat st;
- char *prog[2];
if (s->islog) return 0;
strcpy(a, "control/?");
@@ -267,13 +266,11 @@ static unsigned custom(struct svdir *s, char c)
/* child */
if (haslog && dup2(logpipe.wr, 1) == -1)
warn_cannot("setup stdout for control/?");
- prog[0] = a;
- prog[1] = NULL;
- execv(a, prog);
+ execl(a, a, (char *) NULL);
fatal_cannot("run control/?");
}
/* parent */
- while (safe_waitpid(pid, &w, 0) == -1) {
+ if (safe_waitpid(pid, &w, 0) == -1) {
warn_cannot("wait for child control/?");
return 0;
}