[PATCH] cvsimport: avoid open "-|" list form for Perl 5.6

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Junio C Hamano
Date: Monday, February 20, 2006 - 3:19 pm

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 * Fifth of the four patch series.  I cannot count ;-).

 git-cvsimport.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

eb815c1bb8a40ae18d80e99f8547137ea05318bf
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 24f9834..b46469a 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -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;
-- 
1.2.2.g5be4ea


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Should we support Perl 5.6?, Johannes Schindelin, (Mon Feb 20, 11:37 am)
Re: Should we support Perl 5.6?, Eric Wong, (Mon Feb 20, 12:10 pm)
Re: Should we support Perl 5.6?, Andreas Ericsson, (Mon Feb 20, 2:01 pm)
Re: Should we support Perl 5.6?, Junio C Hamano, (Mon Feb 20, 2:15 pm)
[PATCH] cvsimport: avoid open "-|" list form for Perl 5.6, Junio C Hamano, (Mon Feb 20, 3:19 pm)
NT directory traversal speed on 25K files on Cygwin, Rutger Nijlunsing, (Sun Feb 26, 4:17 pm)
Re: NT directory traversal speed on 25K files on Cygwin, Christopher Faylor, (Sun Feb 26, 6:18 pm)
Re: NT directory traversal speed on 25K files on Cygwin, Andreas Ericsson, (Mon Feb 27, 2:19 am)
Re: NT directory traversal speed on 25K files on Cygwin, Rutger Nijlunsing, (Mon Feb 27, 11:30 am)
Re: NT directory traversal speed on 25K files on Cygwin, Christopher Faylor, (Mon Feb 27, 11:34 am)
Re: NT directory traversal speed on 25K files on Cygwin, Rutger Nijlunsing, (Mon Feb 27, 11:45 am)