From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id B6FB720310; Sat, 27 Feb 2016 22:19:10 +0000 (UTC) Date: Sat, 27 Feb 2016 22:19:10 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/1] spawn: fail properly if Inline fails Message-ID: <20160227221910.GA2020@dcvr.yhbt.net> References: <20160227021423.618-1-e@80x24.org> <20160227110045.GA5350@dcvr.yhbt.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160227110045.GA5350@dcvr.yhbt.net> List-Id: We must stash the error correctly when nesting evals, oops :x --- lib/PublicInbox/Spawn.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm index 394a0b4..72cd6c3 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"; -- EW