{"thread":{"id":"24341","subject":"t0005 failing with ksh93 on linux","startedAt":"2010-07-09T03:08:12Z","lastAt":"2010-07-12T06:47:05Z","messageCount":9,"participants":["Jonathan Nieder","Johannes Sixt","Jeff King","Brandon Casey","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"145184","messageId":"20100709030812.GA16877@dert.cs.uchicago.edu","threadId":"24341","inReplyTo":null,"subject":"t0005 failing with ksh93 on linux","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-09T03:08:12Z","receivedAt":"2010-07-09T03:08:12Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nI can’t seem to get test-sigchain to run with ksh93 on linux:\n\n $ ksh\n \n ksh>$ ../bin-wrappers/test-sigchain \n three\n two\n one\n Terminated\n ksh>$ echo $?\n 271\n ksh>$ exit\n $ ../bin-wrappers/test-sigchain \n three\n two\n one\n Terminated\n $ echo $?\n 143\n\nAs a result, t0005-signals.sh fails when run through that\nshell.  Ideas?\n\n$ ksh t0005-signals.sh  -v\nInitialized empty Git repository in /dev/shm/alt-git/t/trash directory.t0005-signals/.git/\nexpecting success: \n[...]\n        test_cmp expect actual\n\nnot ok - 1 sigchain works\n[...]\n$ git describe\nv1.7.2-rc2\n$ ksh --version\n  version         sh (AT&T Research) 93s+ 2008-01-31\n$ uname -s -r -m\nLinux 2.6.26-2-686-bigmem i686\n"},{"id":"145195","messageId":"4C36CA2C.5050305@viscovery.net","threadId":"24341","inReplyTo":"20100709030812.GA16877@dert.cs.uchicago.edu","subject":"[PATCH] t0005: work around strange $? in ksh when program terminated by a signal","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-07-09T07:05:16Z","receivedAt":"2010-07-09T07:05:16Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nksh is known to report $? of programs that terminated by a signal as\n256 + signal number instead of 128 + signal number like other POSIX\ncompliant shells. (ksh's behavior is still POSIX compliant in this regard.)\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\nAm 7/9/2010 5:08, schrieb Jonathan Nieder:\n> I can’t seem to get test-sigchain to run with ksh93 on linux:\n> \n>  $ ksh\n>  \n>  ksh>$ ../bin-wrappers/test-sigchain \n>  three\n>  two\n>  one\n>  Terminated\n>  ksh>$ echo $?\n>  271\n\nksh is not wrong, just strange. See http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02 (last sentence).\n\n -- Hannes\n\n t/t0005-signals.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t0005-signals.sh b/t/t0005-signals.sh\nindex 09f855a..93e58c0 100755\n--- a/t/t0005-signals.sh\n+++ b/t/t0005-signals.sh\n@@ -13,6 +13,7 @@ test_expect_success 'sigchain works' '\n \ttest-sigchain >actual\n \tcase \"$?\" in\n \t143) true ;; # POSIX w/ SIGTERM=15\n+\t271) true ;; # ksh w/ SIGTERM=15\n \t  3) true ;; # Windows\n \t  *) false ;;\n \tesac &&\n-- \n1.7.1.585.gf3448\n"},{"id":"145206","messageId":"20100709115348.GB5740@sigill.intra.peff.net","threadId":"24341","inReplyTo":"4C36CA2C.5050305@viscovery.net","subject":"Re: [PATCH] t0005: work around strange $? in ksh when program terminated by a signal","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-07-09T11:53:48Z","receivedAt":"2010-07-09T11:53:48Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jul 09, 2010 at 09:05:16AM +0200, Johannes Sixt wrote:\n\n> From: Johannes Sixt <j6t@kdbg.org>\n> \n> ksh is known to report $? of programs that terminated by a signal as\n> 256 + signal number instead of 128 + signal number like other POSIX\n> compliant shells. (ksh's behavior is still POSIX compliant in this regard.)\n\nThanks, that fix looks good to me.\n\nAcked-by: Jeff King <peff@peff.net>\n\n-Peff\n"},{"id":"145224","messageId":"20100709143958.GB1980@burratino","threadId":"24341","inReplyTo":"4C36CA2C.5050305@viscovery.net","subject":"Re: [PATCH] t0005: work around strange $? in ksh when program terminated by a signal","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-07-09T14:39:58Z","receivedAt":"2010-07-09T14:39:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Sixt wrote:\n\n> ksh is known to report $? of programs that terminated by a signal as\n> 256 + signal number instead of 128 + signal number like other POSIX\n> compliant shells. (ksh's behavior is still POSIX compliant in this regard.)\n\nThis patch works for me.\n\n $ ksh t0005-signals.sh\n *   ok 1: sigchain works\n * passed all 1 test(s)\n\nThanks for the explanation.\n"},{"id":"145226","messageId":"iOZX7rvipLDwT5DTYGPE0q9TlJfav09nJWqaRsyiefjNds9DpaDw1A@cipher.nrlssc.navy.mil","threadId":"24341","inReplyTo":"4C36CA2C.5050305@viscovery.net","subject":"Re: [PATCH] t0005: work around strange $? in ksh when program terminated by a signal","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-07-09T15:45:06Z","receivedAt":"2010-07-09T15:45:06Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"On 07/09/2010 02:05 AM, Johannes Sixt wrote:\n> From: Johannes Sixt <j6t@kdbg.org>\n> \n> ksh is known to report $? of programs that terminated by a signal as\n> 256 + signal number instead of 128 + signal number like other POSIX\n> compliant shells. (ksh's behavior is still POSIX compliant in this regard.)\n\nThis may only be true for Ksh93.  The Ksh88 man page says that\nthe exit status is 128+signum.  The Public domain Korn shell, and\nksh on IRIX 6.5, Solaris 7, 9, and 10 all exit with the standard\nbehavior of 128+signum.  So, it may be appropriate to change the\ncommit message and comment in t0005 to reflect this fact.\n\n-Brandon\n\n\n>  t/t0005-signals.sh |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n> \n> diff --git a/t/t0005-signals.sh b/t/t0005-signals.sh\n> index 09f855a..93e58c0 100755\n> --- a/t/t0005-signals.sh\n> +++ b/t/t0005-signals.sh\n> @@ -13,6 +13,7 @@ test_expect_success 'sigchain works' '\n>  \ttest-sigchain >actual\n>  \tcase \"$?\" in\n>  \t143) true ;; # POSIX w/ SIGTERM=15\n> +\t271) true ;; # ksh w/ SIGTERM=15\n>  \t  3) true ;; # Windows\n>  \t  *) false ;;\n>  \tesac &&\n"},{"id":"145227","messageId":"AANLkTilrFPb4JLagQdK4QAIwE7zL7KptuY_VhxhKPZBe@mail.gmail.com","threadId":"24341","inReplyTo":"iOZX7rvipLDwT5DTYGPE0q9TlJfav09nJWqaRsyiefjNds9DpaDw1A@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] t0005: work around strange $? in ksh when program terminated by a signal","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-07-09T16:03:30Z","receivedAt":"2010-07-09T16:03:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Fri, Jul 9, 2010 at 15:45, Brandon Casey\n<brandon.casey.ctr@nrlssc.navy.mil> wrote:\n> the exit status is 128+signum.  The Public domain Korn shell, and\n> ksh on IRIX 6.5, Solaris 7, 9, and 10 all exit with the standard\n> behavior of 128+signum.  So, it may be appropriate to change the\n> commit message and comment in t0005 to reflect this fact.\n\ns/standard/conventional/, no?\n"},{"id":"145228","messageId":"lMI9JytvbBVTwy1p_jSAWzeLQeaQ07mdHqcWXaY2o1DXhPqFjYDE2g@cipher.nrlssc.navy.mil","threadId":"24341","inReplyTo":"AANLkTilrFPb4JLagQdK4QAIwE7zL7KptuY_VhxhKPZBe@mail.gmail.com","subject":"Re: [PATCH] t0005: work around strange $? in ksh when program terminated by a signal","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2010-07-09T16:07:53Z","receivedAt":"2010-07-09T16:07:53Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"On 07/09/2010 11:03 AM, Ævar Arnfjörð Bjarmason wrote:\n> On Fri, Jul 9, 2010 at 15:45, Brandon Casey\n> <brandon.casey.ctr@nrlssc.navy.mil> wrote:\n>> the exit status is 128+signum.  The Public domain Korn shell, and\n>> ksh on IRIX 6.5, Solaris 7, 9, and 10 all exit with the standard\n>> behavior of 128+signum.  So, it may be appropriate to change the\n>> commit message and comment in t0005 to reflect this fact.\n> \n> s/standard/conventional/, no?\n\nsure.\n"},{"id":"145349","messageId":"4C3AB909.80205@viscovery.net","threadId":"24341","inReplyTo":"iOZX7rvipLDwT5DTYGPE0q9TlJfav09nJWqaRsyiefjNds9DpaDw1A@cipher.nrlssc.navy.mil","subject":"[PATCH v2] t0005: work around strange $? in ksh93 when program terminated by a signal","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-07-12T06:41:13Z","receivedAt":"2010-07-12T06:41:13Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nksh93 is known to report $? of programs that terminated by a signal as\n256 + signal number instead of 128 + signal number like other POSIX\ncompliant shells. (ksh's behavior is still POSIX compliant in this regard.)\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\nAcked-by: Jeff King <peff@peff.net>\n---\nAm 7/9/2010 17:45, schrieb Brandon Casey:\n> This may only be true for Ksh93.  The Ksh88 man page says that\n> the exit status is 128+signum.  The Public domain Korn shell, and\n> ksh on IRIX 6.5, Solaris 7, 9, and 10 all exit with the standard\n> behavior of 128+signum.\n\nThanks for you input!\n\nHannes\n\n t/t0005-signals.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t0005-signals.sh b/t/t0005-signals.sh\nindex 09f855a..e17c96a 100755\n--- a/t/t0005-signals.sh\n+++ b/t/t0005-signals.sh\n@@ -13,6 +13,7 @@ test_expect_success 'sigchain works' '\n \ttest-sigchain >actual\n \tcase \"$?\" in\n \t143) true ;; # POSIX w/ SIGTERM=15\n+\t271) true ;; # ksh93 w/ SIGTERM=15\n \t  3) true ;; # Windows\n \t  *) false ;;\n \tesac &&\n-- \n1.7.1.585.gf3448\n"},{"id":"145350","messageId":"7vsk3pdwnq.fsf@alter.siamese.dyndns.org","threadId":"24341","inReplyTo":"4C3AB909.80205@viscovery.net","subject":"Re: [PATCH v2] t0005: work around strange $? in ksh93 when program terminated by a signal","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-12T06:47:05Z","receivedAt":"2010-07-12T06:47:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; I've queued this last week already but have been busy this weekend\nand haven't managed to push anything out.\n"}]}