From 3f4ed681c2e16ab7a73e31835a6a7e29d5857dd7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 14 Nov 2008 16:50:01 +0000 Subject: [PATCH] * Prevent zombies. Previous the SIGCHLD handler only reaped one zombie at a time, so if multiple children died before the handler got to run, some of them would not be cleaned up. --- src/nix-worker/nix-worker.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc index 7511b1c2c..dc9db0be4 100644 --- a/src/nix-worker/nix-worker.cc +++ b/src/nix-worker/nix-worker.cc @@ -534,7 +534,7 @@ static void processConnection() static void sigChldHandler(int sigNo) { /* Reap all dead children. */ - while (waitpid(-1, 0, WNOHANG) == 0) ; + while (waitpid(-1, 0, WNOHANG) > 0) ; }