In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/fd4402024b24e2932365e29708532aff07b488af?hp=e6afd14589235a50ef7aa8ed0ed8c685dd3116d3>

- Log -----------------------------------------------------------------
commit fd4402024b24e2932365e29708532aff07b488af
Author: Tony Cook <[email protected]>
Date:   Fri Jul 12 17:12:46 2013 +1000

    handle multiple children exiting in perlipc example
-----------------------------------------------------------------------

Summary of changes:
 pod/perlipc.pod | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/pod/perlipc.pod b/pod/perlipc.pod
index 69567e9..decb59b 100644
--- 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) {

--
Perl5 Master Repository

Reply via email to