From: Johannes Sixt Date: Sat, 12 Apr 2008 16:13:19 GMT Subject: Re: [PATCH v2 2/3] builtin-status: submodule summary support Message-ID: <200804121813.20050.johannes.sixt@telecom.at> In-Reply-To: <7vtzi8owf9.fsf@gitster.siamese.dyndns.org> On Saturday 12 April 2008 00:31, Junio C Hamano wrote: > Ping Yin writes: > > +static void wt_status_print_submodule_summary(struct wt_status *s) > > +{ > > ... > > + memset(&sm_summary, 0, sizeof(sm_summary)); > > + sm_summary.argv = argv; > > + sm_summary.env = env; > > + sm_summary.git_cmd = 1; > > + sm_summary.no_stdin = 1; > > + fflush(s->fp); > > + sm_summary.out = dup(fileno(s->fp)); /* run_command closes it */ > > + run_command(&sm_summary); > > I recall we had some clean-up on how file descriptors are inherited and > duped around when run_command() runs a subprocess. Hannes, is this dup() > consistent with how the things ought to be these days? Yes, this dup() is required and correct. -- Hannes