projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
try a different strategy
[spider.git]
/
perl
/
cluster.pl
diff --git
a/perl/cluster.pl
b/perl/cluster.pl
index a645da33f7325483e66bb348192595e3b9e99fc1..1e850c90f8b9c74a030a1cab913f770d4d86f218 100755
(executable)
--- a/
perl/cluster.pl
+++ b/
perl/cluster.pl
@@
-66,6
+66,7
@@
use BadWords;
use Data::Dumper;
use Fcntl ':flock';
use Data::Dumper;
use Fcntl ':flock';
+use POSIX ":sys_wait_h";
use Local;
use Local;
@@
-238,9
+239,12
@@
sub cease
# the reaper of children
sub reap
{
# the reaper of children
sub reap
{
- $SIG{'CHLD'} = \&reap;
- my $cpid = wait;
- @outstanding_connects = grep {$_->{pid} != $cpid} @outstanding_connects;
+ my $cpid;
+ while (($cpid = waitpid(1, &WNOHANG)) != -1) {
+ dbg('reap', "cpid: $cpid");
+ @outstanding_connects = grep {$_->{pid} != $cpid} @outstanding_connects;
+ }
+ dbg('reap', "cpid: $cpid");
}
# this is where the input queue is dealt with and things are dispatched off to other parts of
}
# this is where the input queue is dealt with and things are dispatched off to other parts of