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

Re: possible code error at run_command.c

From
Wincent Colaiuta <win@wincent.com>
Date
Dec 21, 2009, 07:09 UTC
Message-ID
<2E55A685-834C-4C64-99F1-4060FEC7C2DB@wincent.com>
In-Reply-To
<1976ea660912202246k45732bf2p111bbeb78047693e@mail.gmail.com>
El 21/12/2009, a las 07:46, Frank Li escribió:
Show 12 quoted lines
> int start_command(struct child_process *cmd)
> {
> 	int need_in, need_out, need_err;
> 	int fdin[2], fdout[2], fderr[2];
> 	int failed_errno = failed_errno;
>
> I have not found failed_errno as global variable.
> failed_errno = failed_errno means nothing.
>
> It is possible coding error and should be
> int failed_errno= 0 or
> failed_errno=errno.
Via "git blame":
commit 5a7a3671b74c043216549b94a718da04cc3ffcd6
Author: David Soria Parra <dsp@php.net>
Date:   Tue Aug 4 11:28:40 2009 +0200
     run-command.c: squelch a "use before assignment" warning
     i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)  
compiler
     (and probably others) mistakenly thinks variable failed_errno is  
used
     before assigned.  Work it around by giving it a fake  
initialization.
     Signed-off-by: David Soria Parra <dsp@php.net>
     Signed-off-by: Junio C Hamano <gitster@pobox.com>

Cheers, Wincent

Previous: Frank LiNext: Johannes Sixt
Message 2 of 11 in “possible code error at run_command.c”
  1. Frank LiDec 21, 2009
  2. Wincent ColaiutaDec 21, 2009
  3. Johannes SixtDec 21, 2009
  4. Frank LiDec 21, 2009
  5. Johannes SixtDec 21, 2009
  6. Frank LiDec 21, 2009
  7. Johannes SixtDec 21, 2009
  8. Erik Faye-LundDec 21, 2009
  9. Johannes SixtDec 21, 2009
  10. Erik Faye-LundDec 21, 2009
  11. Frank LiDec 21, 2009

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.