From: Junio C Hamano <gitster@pobox.com>
To: "Jens Lindström" <jl@opera.com>
Cc: Duy Nguyen <pclouds@gmail.com>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Clear fd after closing to avoid double-close error
Date: Wed, 23 Oct 2013 09:06:53 -0700 [thread overview]
Message-ID: <xmqqvc0oq8de.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAEef6Wyui5EkNoEGKfb+NHZyb3BTkHME234M1zMyjuux5yMUeg@mail.gmail.com> ("Jens Lindström"'s message of "Wed, 23 Oct 2013 09:52:21 +0200")
Jens Lindström <jl@opera.com> writes:
> On Tue, Oct 22, 2013 at 8:42 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Duy Nguyen <pclouds@gmail.com> writes:
>
>>> Life would have been simpler if fd[1] was _always_ closed by
>>> send_pack(), like in c20181e (start_command(), if .in/.out > 0, closes
>>> file descriptors, not the callers - 2008-02-21).
>>
>> Yeah, that was also my first reaction when I saw the above three
>> lines after reading the discussion that led to the diagnosis.
>
> If send_pack() always closes fd[1], then I believe "git send-pack
> --stateless-rpc --helper-status" would die in print_helper_status(),
> called after send_pack(), since fd[1] would be 1, to which
> print_helper_status() will try to write.
Ah, I obviously did not look far enough. Of course we could dup(2)
the fd=1 to code it around, but it is not clear to me if it is worth
it---your solution (v2) is clearer, so let's queue it with Acks we
saw from Peff and Duy.
Thanks.
prev parent reply other threads:[~2013-10-23 16:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 12:10 [PATCH] Clear fd after closing to avoid double-close error Jens Lindström
2013-10-22 12:39 ` Duy Nguyen
2013-10-22 13:15 ` Jens Lindström
2013-10-22 18:42 ` Junio C Hamano
2013-10-23 7:52 ` Jens Lindström
2013-10-23 16:06 ` Junio C Hamano [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqvc0oq8de.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jl@opera.com \
--cc=pclouds@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).