From e6a02743e6411d6e70e4b72e749694445f9ff6db Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Feb 2016 22:18:04 +0000 Subject: spawn: fail properly if Inline fails We must stash the error correctly when nesting evals, oops :x --- lib/PublicInbox/Spawn.pm | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') 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"; -- cgit v1.2.3-24-ge0c7