From f8a73552f16b1fc3b55894db79ebe51967b5d31d Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Wed, 27 Oct 2010 19:34:28 -0700 Subject: [PATCH] reap all zombie children, promted by bug report from Patrik Lundin --- kadmin/kadm_conn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kadmin/kadm_conn.c b/kadmin/kadm_conn.c index 2d45a1aa5..3614267d5 100644 --- a/kadmin/kadm_conn.c +++ b/kadmin/kadm_conn.c @@ -92,7 +92,12 @@ static RETSIGTYPE sigchld(int sig) { int status; - waitpid(-1, &status, 0); + /* + * waitpid() is async safe. will return -1 or 0 on no more zombie + * children + */ + while ((waitpid(-1, &status, WNOHANG)) > 0) + ; SIGRETURN(0); } -- 2.11.4.GIT