aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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;
}