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

Re: [PATCH] compat/mingw.[ch]: Change return type of exec functions to int

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 5, 2012, 22:34 UTC
Message-ID
<20120405223408.GA13910@burratino>
In-Reply-To
<20120405220615.GA11751@sigill.intra.peff.net>
Jeff King wrote:
> I don't have a strong opinion. The "return 0" is a little misleading,
> since it will never be called, but I think we should at least have a
> comment like:
[...]
Show 14 quoted lines
> --- a/run-command.c
> +++ b/run-command.c
> @@ -117,8 +117,11 @@ static int exists_in_PATH(const char *file)
>  
>  int sane_execvp(const char *file, char * const argv[])
>  {
> -	if (!execvp(file, argv))
> -		return 0;
> +	/*
> +	 * No need to check the return value; if it returns at all, an error
> +	 * occurred.
> +	 */
> +	execvp(file, argv);
>  

I'd rather have the "return 0" then. Such a comment that focuses on C library details rather than providing additional information for understanding the sane_execvp function is distracting.

Previous: Jeff KingNext: Jeff King
Message 4 of 8 in “compat/mingw.[ch]: Change return type of exec functions to int”
  1. compat/mingw.[ch]: Change return type of exec functions to intRamsay Jones, Apr 5, 2012
  2. Jonathan NiederApr 5, 2012
  3. Jeff KingApr 5, 2012
  4. Jonathan NiederApr 5, 2012
  5. Jeff KingApr 6, 2012
  6. Jonathan NiederApr 6, 2012
  7. Jeff KingApr 6, 2012
  8. Junio C HamanoApr 6, 2012

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.