about summary refs log tree commit homepage
path: root/lib/PublicInbox/Spawn.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-27 22:18:04 +0000
committerEric Wong <e@80x24.org>2016-02-27 22:18:04 +0000
commite6a02743e6411d6e70e4b72e749694445f9ff6db (patch)
tree3a21681e29dd237f8b095bb846bcc11ebcd7fb29 /lib/PublicInbox/Spawn.pm
parent052f26f3ada1042afa5acadbecc48b487f4e2d52 (diff)
downloadpublic-inbox-e6a02743e6411d6e70e4b72e749694445f9ff6db.tar.gz
We must stash the error correctly when nesting evals, oops :x
Diffstat (limited to 'lib/PublicInbox/Spawn.pm')
-rw-r--r--lib/PublicInbox/Spawn.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm
index 394a0b45..72cd6c3c 100644
--- a/lib/PublicInbox/Spawn.pm
+++ b/lib/PublicInbox/Spawn.pm
@@ -111,7 +111,9 @@ if (defined $vfork_spawn) {
                 open my $fh, '>', $f or die "failed to open $f: $!\n";
                 flock($fh, LOCK_EX) or die "LOCK_EX failed on $f: $!\n";
                 eval 'use Inline C => $vfork_spawn';
+                my $err = $@;
                 flock($fh, LOCK_UN) or die "LOCK_UN failed on $f: $!\n";
+                die $err if $err;
         };
         if ($@) {
                 warn "Inline::C failed for vfork: $@\n";