]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Import.pm
spawn (and thus popen_rd) die on failure
[public-inbox.git] / lib / PublicInbox / Import.pm
index 46de09c40792c511b835de6bded17b8c8173a1a9..6ac43d372d38d2e99d55bfb101f80e00c56333b6 100644 (file)
@@ -10,7 +10,7 @@ use strict;
 use warnings;
 use base qw(PublicInbox::Lock);
 use PublicInbox::Spawn qw(spawn);
-use PublicInbox::MID qw(mids mid_mime mid2path);
+use PublicInbox::MID qw(mids mid2path);
 use PublicInbox::Address;
 use PublicInbox::MsgTime qw(msg_timestamp msg_datestamp);
 use PublicInbox::ContentId qw(content_digest);
@@ -66,9 +66,8 @@ sub gfi_start {
        my $git_dir = $git->{git_dir};
        my @cmd = ('git', "--git-dir=$git_dir", qw(fast-import
                        --quiet --done --date-format=raw));
-       my $rdr = { 0 => fileno($out_r), 1 => fileno($in_w) };
+       my $rdr = { 0 => $out_r, 1 => $in_w };
        my $pid = spawn(\@cmd, undef, $rdr);
-       die "spawn fast-import failed: $!" unless defined $pid;
        $out_w->autoflush(1);
        $self->{in} = $in_r;
        $self->{out} = $out_w;
@@ -430,7 +429,6 @@ sub add {
 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";
 }
@@ -623,7 +621,7 @@ PublicInbox::Import - message importer for public-inbox v1 inboxes
 
 version 1.0
 
-=head1 SYNOPSYS
+=head1 SYNOPSIS
 
        use Email::MIME;
        use PublicInbox::Git;