projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6afd14
)
handle multiple children exiting in perlipc example
author
Tony Cook
<tony@develop-help.com>
Fri, 12 Jul 2013 07:12:46 +0000
(17:12 +1000)
committer
Tony Cook
<tony@develop-help.com>
Fri, 19 Jul 2013 02:03:43 +0000
(12:03 +1000)
pod/perlipc.pod
patch
|
blob
|
history
diff --git
a/pod/perlipc.pod
b/pod/perlipc.pod
index
69567e9
..
decb59b
100644
(file)
--- a/
pod/perlipc.pod
+++ b/
pod/perlipc.pod
@@
-124,11
+124,10
@@
example:
$SIG{CHLD} = sub {
# don't change $! and $? outside handler
local ($!, $?);
- my $pid = waitpid(-1, WNOHANG);
- return if $pid == -1;
- return unless defined $children{$pid};
- delete $children{$pid};
- cleanup_child($pid, $?);
+ while ( (my $pid = waitpid(-1, WNOHANG)) > 0 ) {
+ delete $children{$pid};
+ cleanup_child($pid, $?);
+ }
};
while (1) {