From: Junio C Hamano Date: Sun, 17 Feb 2008 08:07:34 GMT Subject: Re: [PATCH] start_command(), if .in/.out > 0, closes file descriptors, not the callers Message-ID: <7vodag2egp.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20080217074252.GO24004@spearce.org> "Shawn O. Pearce" writes: > Of course the same argument can be said for fd 0; if the parent does > close(0) before some other open/socket/pipe call then its obviously > possible for the parent to get a fd that it wants the child to take > over and close. > > We're basically assuming that the parent will always keep its > own stdin open if it will be spawning children. We all know what > happens when we assume (we double close file descriptors) but I > think its a reasonable safe assumption to be making. Ok, that unwritten assumption was what confused me. We definitely need Documentation/technical/api-*.txt before any more code, don't you agree?