diff options
author | Eric Wong <e@80x24.org> | 2016-06-21 02:39:27 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-06-21 02:40:44 +0000 |
commit | b04e5cf1bc8969cca74ef764f2de960b1ea821a4 (patch) | |
tree | 2be20349c2691c020e1e5e901081b87d38383823 /lib/PublicInbox/SpawnPP.pm | |
parent | a07ac38854c1308c4b58e13253527ec3b5e7e1f9 (diff) | |
download | public-inbox-b04e5cf1bc8969cca74ef764f2de960b1ea821a4.tar.gz |
fork failures are unfortunately common when Xapian has gigabytes and gigabytes mmapped.
Diffstat (limited to 'lib/PublicInbox/SpawnPP.pm')
-rw-r--r-- | lib/PublicInbox/SpawnPP.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/PublicInbox/SpawnPP.pm b/lib/PublicInbox/SpawnPP.pm index 36223e81..179aba5e 100644 --- a/lib/PublicInbox/SpawnPP.pm +++ b/lib/PublicInbox/SpawnPP.pm @@ -12,7 +12,12 @@ sub public_inbox_fork_exec ($$$$$$) { my $set = POSIX::SigSet->new(); $set->fillset or die "fillset failed: $!"; sigprocmask(SIG_SETMASK, $set, $old) or die "can't block signals: $!"; + my $syserr; my $pid = fork; + unless (defined $pid) { # compat with Inline::C version + $syserr = $!; + $pid = -1; + } if ($pid == 0) { if ($in != 0) { dup2($in, 0) or die "dup2 failed for stdin: $!"; @@ -34,6 +39,7 @@ sub public_inbox_fork_exec ($$$$$$) { } } sigprocmask(SIG_SETMASK, $old) or die "can't unblock signals: $!"; + $! = $syserr; $pid; } |