]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: run_die supports redirects as spawn does
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 29 Mar 2018 20:17:17 +0000 (20:17 +0000)
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>
Thu, 29 Mar 2018 20:17:47 +0000 (20:17 +0000)
We'll be using it in more future tests and scripts.

lib/PublicInbox/Import.pm

index f00c260b55a96d1ea6e9b2ec55a628e992017379..463b44e2e7998e8f4261b696a4f62cb1528cc3b1 100644 (file)
@@ -387,9 +387,9 @@ sub add {
        $self->{tip} = ":$commit";
 }
 
-sub run_die ($;$) {
-       my ($cmd, $env) = @_;
-       my $pid = spawn($cmd, $env, undef);
+sub run_die ($;$$) {
+       my ($cmd, $env, $rdr) = @_;
+       my $pid = spawn($cmd, $env, $rdr);
        defined $pid or die "spawning ".join(' ', @$cmd)." failed: $!";
        waitpid($pid, 0) == $pid or die join(' ', @$cmd) .' did not finish';
        $? == 0 or die join(' ', @$cmd) . " failed: $?\n";