From c5d0f15dbd8087f60b377fa9fc18d08698429189 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 3 Feb 2011 14:14:09 +0100 Subject: [PATCH] libbb: spawn should remove child which failed to exec Signed-off-by: Denys Vlasenko --- libbb/vfork_daemon_rexec.c | 1 + 1 file changed, 1 insertion(+) 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; }