From: Yuval Kogman <nothingmuch@woobling.org>
To: git@vger.kernel.org
Cc: Yuval Kogman <nothingmuch@woobling.org>
Subject: [PATCH] Don't try to reclose in command_close_bidi_pipe
Date: Fri, 30 Jan 2009 06:59:30 +0200 [thread overview]
Message-ID: <1233291570-23295-1-git-send-email-nothingmuch@woobling.org> (raw)
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
next reply other threads:[~2009-01-30 5:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-30 4:59 Yuval Kogman [this message]
2009-01-30 14:35 ` [PATCH] Don't try to reclose in command_close_bidi_pipe Tay Ray Chuan
2009-01-30 15:06 ` Yuval Kogman
2009-01-31 0:03 ` Tay Ray Chuan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1233291570-23295-1-git-send-email-nothingmuch@woobling.org \
--to=nothingmuch@woobling.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).