[Bps-public-commit] r12106 - in Test-HTTP-Server-Simple: .

alexmv at bestpractical.com alexmv at bestpractical.com
Tue May 6 13:40:25 EDT 2008


Author: alexmv
Date: Tue May  6 13:40:24 2008
New Revision: 12106

Modified:
   Test-HTTP-Server-Simple/   (props changed)
   Test-HTTP-Server-Simple/lib/Test/HTTP/Server/Simple.pm

Log:
 r31253 at kohr-ah:  chmrr | 2008-05-06 13:36:17 -0400
  * Don't assume all children processes are ours


Modified: Test-HTTP-Server-Simple/lib/Test/HTTP/Server/Simple.pm
==============================================================================
--- Test-HTTP-Server-Simple/lib/Test/HTTP/Server/Simple.pm	(original)
+++ Test-HTTP-Server-Simple/lib/Test/HTTP/Server/Simple.pm	Tue May  6 13:40:24 2008
@@ -81,15 +81,15 @@
         }
     }
     else {
-        my $done = not @CHILD_PIDS;
-        while (not $done) {
+        while (@CHILD_PIDS) {
             kill 'USR1', @CHILD_PIDS;
             local $SIG{ALRM} = sub {die};
             alarm(5);
             eval {
-                1 while $_ = wait and $_ > 0;
+                my $pid;
+                @CHILD_PIDS = grep {$_ != $pid} @CHILD_PIDS
+                  while $pid = wait and $pid > 0 and @CHILD_PIDS;
             };
-            $done = not $@;
             alarm(0);
         }
     }



More information about the Bps-public-commit mailing list