busybox/bugfix-crond_zombie_no_exit_cmd_bug.patch
Grooooot 08a539dd5c busybox: Package init
Signed-off-by: Grooooot <isula@huawei.com>
2019-12-31 11:56:46 +08:00

21 lines
562 B
Diff

diff --git a/miscutils/crond.c b/miscutils/crond.c
index f6580a9..5f3963d 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -737,6 +737,7 @@ fork_job(const char *user, int mailFd, CronLine *line, bool run_sendmail)
err:
pid = 0;
} /* else: PARENT, FORK SUCCESS */
+ waitpid(pid, NULL, 0);
/*
* Close the mail file descriptor.. we can't just leave it open in
@@ -867,6 +868,7 @@ static pid_t start_one_job(const char *user, CronLine *line)
err:
pid = 0;
}
+ waitpid(pid, NULL, 0);
line->cl_pid = pid;
return pid;
}