[git commit master 1/1] libbb: spawn should remove child which failed to exec

Denys Vlasenko vda.linux at googlemail.com
Thu Feb 3 13:14:09 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=c5d0f15dbd8087f60b377fa9fc18d08698429189
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/vfork_daemon_rexec.c |    1 +
 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;
 	}
-- 
1.7.3.4



More information about the busybox-cvs mailing list