git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Don't try to reclose in command_close_bidi_pipe
@ 2009-01-30  4:59 Yuval Kogman
  2009-01-30 14:35 ` Tay Ray Chuan
  0 siblings, 1 reply; 4+ messages in thread
From: Yuval Kogman @ 2009-01-30  4:59 UTC (permalink / raw)
  To: git; +Cc: Yuval Kogman

Some commands require their standard input to be closed (like
git-commit-tree). This patch changes command_close_bidi_pipe so no
longer tries to close already closed handles, resulting in an error.
---
 perl/Git.pm |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/perl/Git.pm b/perl/Git.pm
index 7d7f2b1..283bba8 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -422,6 +422,7 @@ sub command_close_bidi_pipe {
 	local $?;
 	my ($pid, $in, $out, $ctx) = @_;
 	foreach my $fh ($in, $out) {
+		next unless defined(fileno($fh));
 		unless (close $fh) {
 			if ($!) {
 				carp "error closing pipe: $!";
-- 
1.6.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-31  0:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-30  4:59 [PATCH] Don't try to reclose in command_close_bidi_pipe Yuval Kogman
2009-01-30 14:35 ` Tay Ray Chuan
2009-01-30 15:06   ` Yuval Kogman
2009-01-31  0:03     ` Tay Ray Chuan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).