* gdb.base/signull.c: Use sigsetjmp/siglongjmp instead of
setjmp/longjmp. Use sigaction instead of signal.
This commit is contained in:
parent
20e56c33af
commit
725603e12f
|
@ -1,3 +1,8 @@
|
|||
2004-05-20 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
|
||||
|
||||
* gdb.base/signull.c: Use sigsetjmp/siglongjmp instead of
|
||||
setjmp/longjmp. Use sigaction instead of signal.
|
||||
|
||||
2004-05-19 J. Brobecker <brobecker@gnat.com>
|
||||
Michael Snyder <msnyder@redhat.com>
|
||||
|
||||
|
|
|
@ -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 ();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue