cvsimport: avoid open "-|" list form for Perl 5.6
authorJunio C Hamano <junkio@cox.net>
Mon, 20 Feb 2006 22:17:28 +0000 (14:17 -0800)
committerJunio C Hamano <junkio@cox.net>
Mon, 20 Feb 2006 22:24:06 +0000 (14:24 -0800)
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-cvsimport.perl

index 24f9834..b46469a 100755 (executable)
@@ -846,8 +846,12 @@ while(<CVS>) {
                        print "Drop $fn\n" if $opt_v;
                } else {
                        print "".($init ? "New" : "Update")." $fn: $size bytes\n" if $opt_v;
-                       open my $F, '-|', "git-hash-object -w $tmpname"
+                       my $pid = open(my $F, '-|');
+                       die $! unless defined $pid;
+                       if (!$pid) {
+                           exec("git-hash-object", "-w", $tmpname)
                                or die "Cannot create object: $!\n";
+                       }
                        my $sha = <$F>;
                        chomp $sha;
                        close $F;