Code

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 24f983434249e0c37b7f2229e73c70b374403dc4..b46469ab32fa5707c8056c5a32db61d7c268e50b 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;