From: Johannes Sixt Date: Mon, 26 Apr 2010 06:16:43 GMT Subject: Re: [PATCH] start_command: close cmd->err descriptor when fork/spawn fails Message-ID: <4BD52FCB.6020902@viscovery.net> In-Reply-To: <1272244540-5960-1-git-send-email-dvornik+git@gmail.com> Am 4/26/2010 3:15, schrieb bert Dvornik: > Fix the problem where the cmd->err passed into start_command wasn't > being properly closed when certain types of errors occurr. (Compare > the affected code with the clean shutdown code later in the function.) > diff --git a/run-command.c b/run-command.c > index d1a8ceb..41666ac 100644 > --- a/run-command.c > +++ b/run-command.c > @@ -383,6 +383,8 @@ fail_pipe: > close(cmd->out); > if (need_err) > close_pair(fderr); > + else if (cmd->err) > + close(cmd->err); > errno = failed_errno; > return -1; > } Good catch! This should go on maint (1.7.0). Acked-by: Johannes Sixt -- Hannes