summaryrefslogtreecommitdiffstats
path: root/winsup/testsuite/winsup.api/resethand.c
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/testsuite/winsup.api/resethand.c')
-rw-r--r--winsup/testsuite/winsup.api/resethand.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/winsup/testsuite/winsup.api/resethand.c b/winsup/testsuite/winsup.api/resethand.c
index c8b92b242..776d9ac19 100644
--- a/winsup/testsuite/winsup.api/resethand.c
+++ b/winsup/testsuite/winsup.api/resethand.c
@@ -9,7 +9,7 @@ void
ouch (int sig)
{
fprintf (stderr, "ouch %d\n", sig);
- if (doit++ == 0)
+ if (doit++ > 0)
kill (getpid (), SIGTERM);
}
@@ -20,16 +20,17 @@ main (int argc, char **argv)
if (argc == 1)
act.sa_flags = SA_RESETHAND;
act.sa_handler = ouch;
- sigaction (SIGTERM, &act, NULL);
+ sigaction (SIGSEGV, &act, NULL);
int pid = fork ();
int status;
if (pid > 0)
waitpid (pid, &status, 0);
else
{
- kill (getpid (), SIGTERM);
- exit (0x27);
+ int *i = 0;
+ *i = 9;
+ exit (0x42);
}
fprintf (stderr, "pid %d exited with status %p\n", pid, status);
- exit (argc == 1 ? !(status == SIGTERM) : !(status == 0x2700));
+ exit (argc == 1 ? !(status == SIGSEGV) : !(status == SIGTERM));
}