]> Sergey Matveev's repositories - public-inbox.git/commitdiff
spawn: fail properly if Inline fails
authorEric Wong <e@80x24.org>
Sat, 27 Feb 2016 22:18:04 +0000 (22:18 +0000)
committerEric Wong <e@80x24.org>
Sat, 27 Feb 2016 22:18:04 +0000 (22:18 +0000)
We must stash the error correctly when nesting evals, oops :x

lib/PublicInbox/Spawn.pm

index 394a0b453e342cdf3ef4a2ac328d1125aa6721e6..72cd6c3cc4fce032bb8ce36b025854dbeb5b67b4 100644 (file)
@@ -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";