Re: [PATCH] Clear fd after closing to avoid double-close error
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 22, 2013, 18:42 UTC
- Message-ID
- <xmqq8uxltaeh.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CACsJy8DtvaojrrQr4=uYCRse7N+SXb+WdjY+C_0FRSjYsNC6zg@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 10 quoted lines
> On Tue, Oct 22, 2013 at 7:10 PM, Jens Lindström <jl@opera.com> wrote: > ... >> + if (!args->stateless_rpc) >> + /* Closed by pack_objects() via start_command() */ >> + fd[1] = -1; >> } > ... > 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.