Re: [PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> On Tue, Jul 15, 2008 at 10:54:25PM -0700, Junio C Hamano wrote:
>
>> Anything that returns error() from its cmd_xxx() routine, for example,
>> would end up exiting with (-1).  Is it "such bogus" error codes, though?
>
> I think it is bogus, because it is being implicitly truncated to an
> unsigned 8-bit value (at least on Linux -- I have no idea what other
> platforms do). 

"Only the least significant 8 bits (that is, status & 0377) shall be
available to a waiting parent process".  So it is not just "at least on
Linux" but is a well defined behaviour.

http://www.opengroup.org/onlinepubs/000095399/functions/exit.html

I would however agree that when we do mean 255 we should probably write
255, not (-1).  It is easier to document things that way.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux