Subject: | add EAGAIN support for failed fork |
Currently, the Fork() routine will only retry failed forks if the EAGAIN
error message matches /No more process/. This is not the case with
linux at least. Adding the POSIX::EAGAIN check will improve portability
for this module.
Subject: | proc_daemon_eagain.patch |
diff -Naur old/Daemon.pm new/Daemon.pm
--- old/Daemon.pm 2003-06-20 08:53:09.000000000 +1000
+++ new/Daemon.pm 2006-06-06 19:10:01.000000000 +1000
@@ -43,7 +43,7 @@
FORK: {
if (defined($pid = fork)) {
return $pid;
- } elsif ($! =~ /No more process/) {
+ } elsif (($! =~ /No more process/) || ($! == POSIX::EAGAIN())) {
sleep 5;
redo FORK;
} else {