[Catalyst-commits] r7069 - in Catalyst-Runtime/5.70/trunk: . lib/Catalyst/Engine

andyg at dev.catalyst.perl.org andyg at dev.catalyst.perl.org
Fri Oct 26 05:44:42 GMT 2007


Author: andyg
Date: 2007-10-26 05:44:42 +0100 (Fri, 26 Oct 2007)
New Revision: 7069

Modified:
   Catalyst-Runtime/5.70/trunk/Changes
   Catalyst-Runtime/5.70/trunk/lib/Catalyst/Engine/HTTP.pm
Log:
Patch from Jon Schutz to add a proper SIGCHLD repear to Engine::HTTP to fix issue with system() returning -1 instead of the correct value

Modified: Catalyst-Runtime/5.70/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.70/trunk/Changes	2007-10-26 04:35:27 UTC (rev 7068)
+++ Catalyst-Runtime/5.70/trunk/Changes	2007-10-26 04:44:42 UTC (rev 7069)
@@ -1,6 +1,10 @@
 # This file documents the revision history for Perl extension Catalyst.
 
-5.7011
+5.7012
+        - Fixed Engine::HTTP to use a proper SIGCHLD repear. Should fix issues with 
+          system() calls returning -1 instead of the correct value. (Jon Schutz)
+
+5.7011  2007-10-18 20:40:00
         - Allow multiple restart directories and added option to follow
           symlinks in the HTTP::Restarter engine (Sebastian Willert)
         - Fixed t/optional_http-server-restart.t so it actually tests

Modified: Catalyst-Runtime/5.70/trunk/lib/Catalyst/Engine/HTTP.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/lib/Catalyst/Engine/HTTP.pm	2007-10-26 04:35:27 UTC (rev 7068)
+++ Catalyst-Runtime/5.70/trunk/lib/Catalyst/Engine/HTTP.pm	2007-10-26 04:44:42 UTC (rev 7069)
@@ -11,6 +11,7 @@
 use Socket;
 use IO::Socket::INET ();
 use IO::Select       ();
+use POSIX ":sys_wait_h";
 
 # For PAR
 require Catalyst::Engine::HTTP::Restarter;
@@ -189,7 +190,7 @@
     }
 
     my $restart = 0;
-    local $SIG{CHLD} = 'IGNORE';
+    local $SIG{CHLD} = \&_REAPER;
 
     my $allowed = $options->{allowed} || { '127.0.0.1' => '255.255.255.255' };
     my $addr = $host ? inet_aton($host) : INADDR_ANY;
@@ -525,6 +526,12 @@
 
 sub _inet_addr { unpack "N*", inet_aton( $_[0] ) }
 
+sub _REAPER {
+    my $child;
+    while ( ( $child = waitpid( -1,WNOHANG ) ) > 0 ) { }
+    $SIG{CHLD} = \&_REAPER;
+}
+
 =head1 SEE ALSO
 
 L<Catalyst>, L<Catalyst::Engine>.




More information about the Catalyst-commits mailing list