From: Jeff King <peff@peff.net>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH v2 3/5] chain kill signals for cleanup functions
Date: Fri, 30 Jan 2009 03:21:01 -0500 [thread overview]
Message-ID: <20090130082101.GA28809@coredump.intra.peff.net> (raw)
In-Reply-To: <4982B68C.2070207@viscovery.net>
On Fri, Jan 30, 2009 at 09:13:00AM +0100, Johannes Sixt wrote:
> Jeff King schrieb:
> > One fix would be to just "signal(SIGINT, SIG_DFL)" at the top. But I
> > think it makes the test cleaner to just switch to a more reliable
> > signal. The patch would look something like what is below. But I need to
> > know what exit code Windows generates for SIGTERM. Johannes?
>
> The same as with SIGINT: 3.
Hmm. Clever.
Junio, can you apply this on top of the jk/signal-cleanup topic?
-- >8 --
Subject: [PATCH] t0005: use SIGTERM for sigchain test
The signal tests consists of checking that each of our
handlers is executed, and that the test program was killed
by the final signal. We arbitrarily used SIGINT as the kill
signal.
However, some platforms (notably Solaris) will default
SIGINT to SIG_IGN if there is no controlling terminal. In
that case, we don't end up killing the program with the
final signal and the test fails.
This is a problem since the test script should not depend
on outside factors; let's use SIGTERM instead, which should
behave consistently.
Signed-off-by: Jeff King <peff@peff.net>
---
t/t0005-signals.sh | 2 +-
test-sigchain.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/t/t0005-signals.sh b/t/t0005-signals.sh
index 9707af7..09f855a 100755
--- a/t/t0005-signals.sh
+++ b/t/t0005-signals.sh
@@ -12,7 +12,7 @@ EOF
test_expect_success 'sigchain works' '
test-sigchain >actual
case "$?" in
- 130) true ;; # POSIX w/ SIGINT=2
+ 143) true ;; # POSIX w/ SIGTERM=15
3) true ;; # Windows
*) false ;;
esac &&
diff --git a/test-sigchain.c b/test-sigchain.c
index 8747dea..42db234 100644
--- a/test-sigchain.c
+++ b/test-sigchain.c
@@ -14,9 +14,9 @@ X(three)
#undef X
int main(int argc, char **argv) {
- sigchain_push(SIGINT, one);
- sigchain_push(SIGINT, two);
- sigchain_push(SIGINT, three);
- raise(SIGINT);
+ sigchain_push(SIGTERM, one);
+ sigchain_push(SIGTERM, two);
+ sigchain_push(SIGTERM, three);
+ raise(SIGTERM);
return 0;
}
--
1.6.1.2.420.ga6a64.dirty
next prev parent reply other threads:[~2009-01-30 8:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-22 3:55 What's cooking in git.git (Jan 2009, #05; Wed, 21) Junio C Hamano
2009-01-22 4:26 ` Jeff King
2009-01-22 5:57 ` [PATCH v2 1/5] Windows: Fix signal numbers Jeff King
2009-01-22 5:59 ` [PATCH v2 2/5] diff: refactor tempfile cleanup handling Jeff King
2009-01-22 6:02 ` [PATCH v2 3/5] chain kill signals for cleanup functions Jeff King
2009-01-30 7:55 ` Jeff King
2009-01-30 8:13 ` Johannes Sixt
2009-01-30 8:21 ` Jeff King [this message]
2009-01-31 0:28 ` Junio C Hamano
2009-01-31 1:44 ` Jeff King
2009-01-31 6:50 ` Jeff King
2009-02-01 1:58 ` Junio C Hamano
2009-01-22 6:03 ` [PATCH v2 4/5] refactor signal handling " Jeff King
2009-01-22 6:03 ` [PATCH v2 5/5] pager: do wait_for_pager on signal death Jeff King
2009-01-22 5:13 ` What's cooking in git.git (Jan 2009, #05; Wed, 21) Johannes Schindelin
2009-01-31 6:45 ` Sam Vilain
2009-01-31 7:36 ` Jeff King
2009-02-01 2:39 ` [PATCH] split notes [was: Re: What's cooking in git.git (Jan 2009, #05; Wed, 21)] Sam Vilain
2009-02-01 3:09 ` Sam Vilain
2009-02-01 12:01 ` Jakub Narebski
2009-01-22 5:21 ` What's cooking in git.git (Jan 2009, #05; Wed, 21) Boyd Stephen Smith Jr.
2009-01-23 6:23 ` Junio C Hamano
2009-01-27 1:43 ` Boyd Stephen Smith Jr.
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=20090130082101.GA28809@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.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).