From 74c29a5e9a63d106feee043f2f6b110979086e67 Mon Sep 17 00:00:00 2001
From: Christopher Faylor <me@cgf.cx>
Date: Sun, 1 Jan 2006 18:02:54 +0000
Subject: [PATCH] * winsup.api/resethand.c: Use SIGSEGV for the signal to test.

---
 winsup/testsuite/ChangeLog              |  4 ++++
 winsup/testsuite/winsup.api/resethand.c | 11 ++++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/winsup/testsuite/ChangeLog b/winsup/testsuite/ChangeLog
index 5c4550386..d78aa61fd 100644
--- a/winsup/testsuite/ChangeLog
+++ b/winsup/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2006-01-01  Christopher Faylor  <cgf@timesys.com>
+
+	* winsup.api/resethand.c: Use SIGSEGV for the signal to test.
+
 2006-01-01  Christopher Faylor  <cgf@timesys.com>
 
 	* winsup.api/resethand.c: New file.
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));
 }