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

Re: bug & patch: exit codes from internal commands are handled incorrectly

From
Torsten Bögershausen <tboegi@web.de>
Date
Dec 18, 2014, 17:43 UTC
Message-ID
<54931233.6080900@web.de>
In-Reply-To
<885593BD-3024-4811-83A5-D3A0C4CE6AC1@his.com>
On 18.12.14 03:15, Kenneth Lorber wrote:
Show 9 quoted lines
> The situation is actually slightly more complex than I stated previously.  From the docs:
>   The exit value of this program is negative on error,
> But there’s no such thing as a negative error code under Unix, so (at best) that will be exit(255).
> 
> No patch, because this is getting painfully close to needing someone with a global view of the code to fix.
> 
> Thanks,
> Keni
> 

My spontanous question: Would it be save to clamp at 127 ?

>> +       if (status > 127)
>> +               status = 127;   /* prevent exit() from truncating to 0 or becoming negative */

(And the rest looked good enough to become a patch, or at least to start a wider discussion)

Previous: Kenneth LorberNext: Junio C Hamano
Message 3 of 8 in “bug & patch: exit codes from internal commands are handled incorrectly”
  1. Kenneth LorberDec 16, 2014
  2. Kenneth LorberDec 18, 2014
  3. Torsten BögershausenDec 18, 2014
  4. Junio C HamanoDec 18, 2014
  5. Kenneth LorberDec 20, 2014
  6. Kenneth LorberFeb 1, 2015
  7. Kenneth LorberApr 1, 2015
  8. Junio C HamanoApr 1, 2015

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.