[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getopt-gnu: fix exit code overflow
From: |
Bruno Haible |
Subject: |
Re: getopt-gnu: fix exit code overflow |
Date: |
Tue, 19 Jun 2012 14:05:42 +0200 |
User-agent: |
KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; ) |
Hi Eric,
> 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.
Thanks for explaining.
Since our test programs are invoked from a shell and all we see is $?,
not from a C program where we could distinguish raise(SIGSEGV) from exit(139),
I think we should continue to use the rule "all exit codes should be < 128",
both in m4/* and tests/*.
Bruno