Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-01-01 21:02:54 +0300
committerChristopher Faylor <me@cgf.cx>2006-01-01 21:02:54 +0300
commit74c29a5e9a63d106feee043f2f6b110979086e67 (patch)
tree7f2f894862aecb069edc5232d79724495309696c /winsup/testsuite
parent031d1aa40f8e7971e946ff49cf9147392871ae0a (diff)
* winsup.api/resethand.c: Use SIGSEGV for the signal to test.
Diffstat (limited to 'winsup/testsuite')
-rw-r--r--winsup/testsuite/ChangeLog4
-rw-r--r--winsup/testsuite/winsup.api/resethand.c11
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,5 +1,9 @@
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.
2005-12-11 Christopher Faylor <cgf@timesys.com>
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));
}