Prevent infinite loop (with logging) in child process reaping.
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 2 Dec 2009 22:42:36 +0000 (22:42 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 2 Dec 2009 22:42:36 +0000 (22:42 +0000)
From the perl docs on waitpid:

Note that on some systems, a return value of "-1" could mean that child processes are being automatically reaped.  See perlipc for details, and for other examples.

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1865 9efc2488-bf62-4759-914b-345cdb29e865

bin/opensrf-perl.pl.in

index 80b7df6..d95d990 100755 (executable)
@@ -127,6 +127,7 @@ sub do_start {
         launch_listener($service);
         $0 = "OpenSRF controller [$service]";
         while(my $pid = waitpid(-1, 0)) {
+            last if $pid == -1;
             $logger->debug("Cleaning up Perl $service process $pid");
         }
     }