From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Jeff King <peff@peff.net>, Stephan Beyer <s-beyer@gmx.net>,
git@vger.kernel.org
Subject: Re: [PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only
Date: Thu, 17 Jul 2008 00:25:44 -0700 [thread overview]
Message-ID: <7vabghkm4n.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <487EF31D.8090007@viscovery.net> (Johannes Sixt's message of "Thu, 17 Jul 2008 09:22:05 +0200")
Johannes Sixt <j.sixt@viscovery.net> writes:
> Jeff King schrieb:
>> On Wed, Jul 16, 2008 at 11:31:41PM -0700, Junio C Hamano wrote:
>>> Is it that somebody do not want 255 exit value, or anything that has 7th
>>> bit set? 2488df8 (builtin run_command: do not exit with -1., 2007-11-13)
>>> suggests otherwise at least for Windows runtime, so what we currently have
>>> that does extra truncation ourselves might be sufficient.
>>
>> Johannes will have to answer that; however, the truncation there does
>> leave the extra 7th bit. Maybe & 0x7f would be more appropriate?
>
> I never found out the real reason why -1 would not be recognized as
> "failure"; the conclusion of my debugging session was that MSYS bash has
> an issue, and I chose to append '& 0xff' because the documentation of
> WEXITSTATUS() says that it can receive only 8 bits of the exit() code. The
> intention of 2488df8 was to keep as much information as possible. But if
> that extra information hurts, we should better truncate to 7 bits.
>
> The source code of Windows's C runtime suggests that any value that fits
> in 4 bytes can be supplied to exit() and can be received by cwait()
> (Windows's version of waitpid()); but I haven't looked at how MSYS
> implements waitpit() and whether it can receive that much information.
Well, POSIX cannot do that much anyway, but does allow 8-bit, so I'd say
the current code is fine.
next prev parent reply other threads:[~2008-07-17 7:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-12 15:47 [PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only Stephan Beyer
2008-07-12 15:47 ` [PATCH 2/2] t/: Use "test_must_fail git" instead of "! git" Stephan Beyer
2008-07-12 16:04 ` Jakub Narebski
2008-07-12 21:43 ` Stephan Beyer
2008-07-12 21:30 ` [SQUASH PATCH] t9001: " Stephan Beyer
2008-07-16 5:18 ` [PATCH 1/2] t/test-lib.sh: Let test_must_fail fail on signals only Jeff King
2008-07-16 5:54 ` Junio C Hamano
2008-07-17 5:18 ` Jeff King
2008-07-17 5:38 ` Junio C Hamano
2008-07-17 6:01 ` Jeff King
2008-07-17 6:31 ` Junio C Hamano
2008-07-17 6:38 ` Jeff King
2008-07-17 7:22 ` Johannes Sixt
2008-07-17 7:25 ` Junio C Hamano [this message]
2008-07-16 11:57 ` Stephan Beyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vabghkm4n.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=j.sixt@viscovery.net \
--cc=peff@peff.net \
--cc=s-beyer@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).