From d0afb12646d78ccf22bd9115112f31bd54392802 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Mon, 20 Feb 2012 14:31:23 +0100 Subject: [PATCH] Fixed zombie process caused by bad waitpid call --- src/networkpluginserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/networkpluginserver.cpp b/src/networkpluginserver.cpp index 756cff77..a89117b6 100644 --- a/src/networkpluginserver.cpp +++ b/src/networkpluginserver.cpp @@ -175,7 +175,7 @@ static void SigCatcher(int n) { int status; // Read exit code from all children to not have zombies arround // WARNING: Do not put LOG4CXX_ here, because it can lead to deadlock - while ((result = waitpid(0, &status, WNOHANG)) > 0) { + while ((result = waitpid(-1, &status, WNOHANG)) > 0) { if (result != 0) { if (WIFEXITED(status)) { if (WEXITSTATUS(status) != 0) {