From: Ian Jackson Date: Fri, 19 Aug 2022 23:34:31 +0000 (+0100) Subject: prefork-interp: fixes X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=49da42c73d3eac1d85f7e89e07beeed88e64f389;p=chiark-utils.git prefork-interp: fixes Signed-off-by: Ian Jackson --- diff --git a/perl/Prefork.pm b/perl/Prefork.pm index 2176653..466b2a9 100644 --- a/perl/Prefork.pm +++ b/perl/Prefork.pm @@ -221,7 +221,7 @@ sub initialisation_complete { if (%children) { my $full = %children >= $num_servers; my $got = waitpid -1, ($full ? 0 : WNOHANG); - $got >= 0 or fail_log("failed to wait for monitor(s)"); + $got >= 0 or fail_log("failed to wait for monitor(s): $!"); if ($got) { if ($?) { syslog(LOG_WARNING, @@ -256,7 +256,7 @@ sub initialisation_complete { if ($r > 0) { chomp $msgbuf; fail_log("watcher: $msgbuf"); - } elsif ($r == 0) { + } elsif (defined $r) { last; } elsif ($! == EINTR || $! == EAGAIN || $! == EWOULDBLOCK) { } else {