From 50658a091d92a13b20823326a9f864d1a08817ba Mon Sep 17 00:00:00 2001 From: minima Date: Thu, 16 Nov 2000 16:24:01 +0000 Subject: [PATCH] changed wait to waitpid in reaping --- Changes | 2 ++ perl/cluster.pl | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 1162d9d1..4c4a089a 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +16Nov00======================================================================= +1. Alter the process reaping code in cluster.pl to use waitpid 12Nov00======================================================================= 1. Fix lack 't' action in Filter.pm 08Nov00======================================================================= diff --git a/perl/cluster.pl b/perl/cluster.pl index a645da33..eabc56e6 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -66,6 +66,7 @@ use BadWords; use Data::Dumper; use Fcntl ':flock'; +use POSIX ":sys_wait_h"; use Local; @@ -239,8 +240,10 @@ sub cease sub reap { $SIG{'CHLD'} = \&reap; - my $cpid = wait; - @outstanding_connects = grep {$_->{pid} != $cpid} @outstanding_connects; + my $cpid; + while (($cpid = waitpid(1, &WNOHANG) != -1)) { + @outstanding_connects = grep {$_->{pid} != $cpid} @outstanding_connects; + } } # this is where the input queue is dealt with and things are dispatched off to other parts of -- 2.43.0