Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Clear fd after closing to avoid double-close error

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:59:04

Jens Lindström [off-list ref] writes:
On Tue, Oct 22, 2013 at 8:42 PM, Junio C Hamano [off-list ref] wrote:
quoted
Duy Nguyen [off-list ref] writes:
quoted
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help