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

From: Torsten Bögershausen <[email-masked]>
Date: Thu, 18 Dec 2014 18:43:15 +0100

On 18.12.14 03:15, Kenneth Lorber wrote:
> 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)