On 06/19/2012 04:11 AM, Bruno Haible wrote: > Exit codes are limited to be < 128. Values between 128 and 255 are reported > as core dumps by the invoking shell.
Not true. waitpid() distinguishes between normal exits > 128 and a signal exit, and all existing shells are good about only reporting core dumps or other signal exits when waitpid() says the child exits via signal. It's just the ambiguity that results when dealing with $? after the fact, if you are trying to analyze the failure; and for this particular .m4 snippet, the chance of a signal is so slim that we are safe analyzing values > 128. Furthermore, POSIX permits, and ksh implements, the ability to report signal exits in the range > 255 while still within the shell (only mapping $? back to 128-255 when leaving the shell), so that it is possible to distinguish in shell whether $? represents a signal or a normal exit. > To avoid such misinterpretations, > this fix. The problem was introduced on 2011-07-07. ACK to this fix, at any rate. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature