diff options
author | Eric Wong <e@80x24.org> | 2023-09-26 07:44:36 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-09-26 21:02:39 +0000 |
commit | 258412f81ca477c0f86101c3dfeeab0ec19d906c (patch) | |
tree | 7b464ea6a597929c0c85a184afbbf7c7a4539ff6 /lib/PublicInbox/AutoReap.pm | |
parent | 77cbe5178ad09f239f4362f712a42410dd233544 (diff) | |
download | public-inbox-258412f81ca477c0f86101c3dfeeab0ec19d906c.tar.gz |
Reading the Perl source, it seems impossible to for waitpid to return undef. perlipc(1) man page also documents waitpid (and `wait') as functions which always restart on EINTR.
Diffstat (limited to 'lib/PublicInbox/AutoReap.pm')
-rw-r--r-- | lib/PublicInbox/AutoReap.pm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/PublicInbox/AutoReap.pm b/lib/PublicInbox/AutoReap.pm index 23ecce77..ae4984b8 100644 --- a/lib/PublicInbox/AutoReap.pm +++ b/lib/PublicInbox/AutoReap.pm @@ -3,8 +3,7 @@ # automatically kill + reap children when this goes out-of-scope package PublicInbox::AutoReap; -use v5.10.1; -use strict; +use v5.12; sub new { my (undef, $pid, $cb) = @_; @@ -21,8 +20,8 @@ sub join { my $pid = delete $self->{pid} or return; $self->{cb}->() if defined $self->{cb}; CORE::kill($sig, $pid) if defined $sig; - my $ret = waitpid($pid, 0) // die "waitpid($pid): $!"; - $ret == $pid or die "BUG: waitpid($pid) != $ret"; + my $r = waitpid($pid, 0); + $r == $pid or die "BUG? waitpid($pid) => $r (\$?=$? \$!=$!)"; } sub DESTROY { |