From: Denys Vlasenko Date: Thu, 3 Feb 2011 13:14:09 +0000 (+0100) Subject: libbb: spawn should remove child which failed to exec X-Git-Tag: 1_19_0~346 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c5d0f15dbd8087f60b377fa9fc18d08698429189;p=oweals%2Fbusybox.git libbb: spawn should remove child which failed to exec Signed-off-by: Denys Vlasenko --- diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index af938bed3..a75eafbd3 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; }