Thread (1 message) 1 message, 1 author, 2026-01-22

Re: [PATCH v7 10/12] run-command: poll child stdin in addition to stdout

From: Junio C Hamano <hidden>
Date: 2026-01-22 17:21:05

Adrian Ratiu [off-list ref] writes:
Yes, it is odd and it's a weirdness of the run-command.c child fd
handling logic where .in, .out and .err are initialized to 0.

Patrick raised this up as well in one of the previous patches, however
reworking run-command to not use 0 sentinel values for fd's is quite the
big unrelated patch (I gave up after spending about 1.5 days on it at
the time).
Thanks.  I didn't realize that this was already discussed.
Maybe one day we can also fix this weird aspect of the run-command API.
At least a comment somewhere would be sufficient to avoid others
waste (your) time like I just did, wondering why fd=0 is special,
even they know that it is unlikely to get fd=0 from a fresh new
open()/dup() etc. in our codebase.

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