From 260366ea670a66a99da6f3a0a85897d306ddc4c0 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 20 Dec 2007 23:20:46 +0000 Subject: Fixing endless loop... --- lib/TaskMan.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/TaskMan.cc b/lib/TaskMan.cc index 24bbf77..c83cf26 100644 --- a/lib/TaskMan.cc +++ b/lib/TaskMan.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: TaskMan.cc,v 1.48 2007-12-20 17:07:11 pixel Exp $ */ +/* $Id: TaskMan.cc,v 1.49 2007-12-20 23:20:46 pixel Exp $ */ #ifndef _WIN32 #include @@ -74,6 +74,8 @@ void TaskMan::CleanChildren() { while (1) { pid = waitpid(-1, &status, WNOHANG); + if ((pid == 0) || (pid == -1)) + break; if (GotChild(pid, status)) { got_sigchild++; } else { -- cgit v1.2.3