Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 0ea8039

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a3da882 commit 0ea8039

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

t/t0005-signals.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ EOF
1212
test_expect_success 'sigchain works' '
1313
test-sigchain >actual
1414
case "$?" in
15-
130) true ;; # POSIX w/ SIGINT=2
15+
143) true ;; # POSIX w/ SIGTERM=15
1616
3) true ;; # Windows
1717
*) false ;;
1818
esac &&

test-sigchain.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ X(three)
1414
#undef X
1515

1616
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);
2121
return 0;
2222
}

0 commit comments

Comments
 (0)