Re: [PATCH] start_command: close cmd->err descriptor when fork/spawn fails
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.)
Show 13 quoted lines
> 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 <j6t@kdbg.org>
-- Hannes