summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-03 13:14:09 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2011-02-03 13:14:09 (GMT)
commitc5d0f15dbd8087f60b377fa9fc18d08698429189 (patch)
treec35004eac3c2754328237dc66d669f7200712d27
parent3237f5c307c066a008909f35115e21c9473504ab (diff)
downloadbusybox-c5d0f15dbd8087f60b377fa9fc18d08698429189.tar.gz
busybox-c5d0f15dbd8087f60b377fa9fc18d08698429189.tar.bz2
libbb: spawn should remove child which failed to exec
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/vfork_daemon_rexec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index af938be..a75eafb 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -52,6 +52,7 @@ pid_t FAST_FUNC spawn(char **argv)
* Interested party can wait on pid and learn exit code.
* If 111 - then it (most probably) failed to exec */
if (failed) {
+ safe_waitpid(pid, NULL, 0); /* prevent zombie */
errno = failed;
return -1;
}