From: Junio C Hamano Date: Fri, 15 Feb 2008 22:14:40 GMT Subject: Re: [PATCH 2/6] Automatically close stderr pipes created by run_command Message-ID: <7v1w7dhnov.fsf@gitster.siamese.dyndns.org> In-Reply-To: <200802152045.37755.johannes.sixt@telecom.at> Johannes Sixt writes: > ... But practically in the case > where a fd > 0 is assigned to .in/.out/.err: > > - case .out, .err: the caller is required to close the fd early after > start_command() because (if this is a pipe) the child won't see EOF; > > - case .in: the caller must not read from the fd anyway, else the child gets > inconsistent input. > > So, while there *is* some inconsistency, the inconsistent cases can be clearly > separated into the cases fd > 0 and fd == -1. Ok, sold.