git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] start_command: close cmd->err descriptor when fork/spawn fails

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Apr 26, 2010, 06:16 UTC
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.)
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
Previous: bert DvornikNext: Johannes Schindelin
Message 2 of 6 in “start_command: close cmd->err descriptor when fork/spawn fails”
  1. start_command: close cmd->err descriptor when fork/spawn failsbert Dvornik, Apr 26, 2010
  2. Johannes SixtApr 26, 2010
  3. Johannes SchindelinApr 26, 2010
  4. Johannes SixtApr 26, 2010
  5. Albert DvornikApr 26, 2010
  6. Junio C HamanoApr 26, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.