Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information...
commit 0ea8039644968e53d79a8dfbf739c87af4261d46 1 parent a3da882
Jeff King authored January 30, 2009 gitster committed January 30, 2009
2  t/t0005-signals.sh
@@ -12,7 +12,7 @@ EOF
12 12
 test_expect_success 'sigchain works' '
13 13
 	test-sigchain >actual
14 14
 	case "$?" in
15  
-	130) true ;; # POSIX w/ SIGINT=2
  15
+	143) true ;; # POSIX w/ SIGTERM=15
16 16
 	  3) true ;; # Windows
17 17
 	  *) false ;;
18 18
 	esac &&
8  test-sigchain.c
@@ -14,9 +14,9 @@ X(three)
14 14
 #undef X
15 15
 
16 16
 int main(int argc, char **argv) {
17  
-	sigchain_push(SIGINT, one);
18  
-	sigchain_push(SIGINT, two);
19  
-	sigchain_push(SIGINT, three);
20  
-	raise(SIGINT);
  17
+	sigchain_push(SIGTERM, one);
  18
+	sigchain_push(SIGTERM, two);
  19
+	sigchain_push(SIGTERM, three);
  20
+	raise(SIGTERM);
21 21
 	return 0;
22 22
 }

0 notes on commit 0ea8039

Please sign in to comment.
Something went wrong with that request. Please try again.