Re: [PATCH] t0005: work around strange $? in ksh when program terminated by a signal
- From
- Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
- Date
- Jul 9, 2010, 15:45 UTC
- Message-ID
- <iOZX7rvipLDwT5DTYGPE0q9TlJfav09nJWqaRsyiefjNds9DpaDw1A@cipher.nrlssc.navy.mil>
- In-Reply-To
- <4C36CA2C.5050305@viscovery.net>
On 07/09/2010 02:05 AM, Johannes Sixt wrote:
Show 5 quoted lines
> From: Johannes Sixt <j6t@kdbg.org> > > ksh is known to report $? of programs that terminated by a signal as > 256 + signal number instead of 128 + signal number like other POSIX > compliant shells. (ksh's behavior is still POSIX compliant in this regard.)
This may only be true for Ksh93. The Ksh88 man page says that the exit status is 128+signum. The Public domain Korn shell, and ksh on IRIX 6.5, Solaris 7, 9, and 10 all exit with the standard behavior of 128+signum. So, it may be appropriate to change the commit message and comment in t0005 to reflect this fact.
-Brandon
Show 15 quoted lines
> t/t0005-signals.sh | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/t/t0005-signals.sh b/t/t0005-signals.sh > index 09f855a..93e58c0 100755 > --- a/t/t0005-signals.sh > +++ b/t/t0005-signals.sh > @@ -13,6 +13,7 @@ test_expect_success 'sigchain works' ' > test-sigchain >actual > case "$?" in > 143) true ;; # POSIX w/ SIGTERM=15 > + 271) true ;; # ksh w/ SIGTERM=15 > 3) true ;; # Windows > *) false ;; > esac &&