aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/signull.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2004-05-20 14:58:54 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2004-05-20 14:58:54 +0000
commit725603e12fe543cba35225e17d69a0c9450beeb4 (patch)
tree6929b56734e0cf3408a8e7c7887cef49a07e8d76 /gdb/testsuite/gdb.base/signull.c
parent20e56c33af778c23728eea255a4724cfab36746d (diff)
downloadgdb-725603e12fe543cba35225e17d69a0c9450beeb4.zip
gdb-725603e12fe543cba35225e17d69a0c9450beeb4.tar.gz
gdb-725603e12fe543cba35225e17d69a0c9450beeb4.tar.bz2
* gdb.base/signull.c: Use sigsetjmp/siglongjmp instead of
setjmp/longjmp. Use sigaction instead of signal.
Diffstat (limited to 'gdb/testsuite/gdb.base/signull.c')
-rw-r--r--gdb/testsuite/gdb.base/signull.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.base/signull.c b/gdb/testsuite/gdb.base/signull.c
index 266a7dc..6c9ad85 100644
--- a/gdb/testsuite/gdb.base/signull.c
+++ b/gdb/testsuite/gdb.base/signull.c
@@ -19,6 +19,7 @@
#include <signal.h>
#include <setjmp.h>
+#include <stdlib.h>
enum tests {
code_entry_point, code_descriptor, data_pointer
@@ -38,7 +39,7 @@ jmp_buf env;
extern void
keeper (int sig)
{
- longjmp (env, 0);
+ siglongjmp (env, 0);
}
extern long
@@ -59,10 +60,15 @@ int
main ()
{
static volatile int i;
- signal (SIGSEGV, keeper);
+
+ struct sigaction act;
+ memset (&act, 0, sizeof act);
+ act.sa_handler = keeper;
+ sigaction (SIGSEGV, &act, NULL);
+
for (i = 0; i < 10; i++)
{
- setjmp (env);
+ sigsetjmp (env, 1);
bowler ();
}
}