From 2510de8d0bcb4ced7652762cbdcbe3fd624519e4 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 20 Aug 2003 14:32:16 +0000 Subject: prims.cc (unblock_signal): New function. 2003-08-19 Andrew Haley * prims.cc (unblock_signal): New function. (SIGNAL_HANDLER): Use it. (SIGNAL_HANDLER): Likewise. From-SVN: r70598 --- libjava/ChangeLog | 6 ++++++ libjava/prims.cc | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) (limited to 'libjava') diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 7fc2069..57f68fe 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,9 @@ +2003-08-19 Andrew Haley + + * prims.cc (unblock_signal): New function. + (SIGNAL_HANDLER): Use it. + (SIGNAL_HANDLER): Likewise. + 2003-08-19 Danny Smith PR libgcj/11575 diff --git a/libjava/prims.cc b/libjava/prims.cc index 9f84773..8208995 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -122,11 +122,26 @@ void (*_Jv_JVMPI_Notify_THREAD_END) (JVMPI_Event *event); #endif +/* Unblock a signal. Unless we do this, the signal may only be sent + once. */ +static void +unblock_signal (int signum) +{ +#ifdef _POSIX_VERSION + sigset_t sigs; + + sigemptyset (&sigs); + sigaddset (&sigs, signum); + sigprocmask (SIG_UNBLOCK, &sigs, NULL); +#endif +} + #ifdef HANDLE_SEGV SIGNAL_HANDLER (catch_segv) { java::lang::NullPointerException *nullp = new java::lang::NullPointerException; + unblock_signal (SIGSEGV); MAKE_THROW_FRAME (nullp); throw nullp; } @@ -137,6 +152,7 @@ SIGNAL_HANDLER (catch_fpe) { java::lang::ArithmeticException *arithexception = new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero")); + unblock_signal (SIGFPE); #ifdef HANDLE_DIVIDE_OVERFLOW HANDLE_DIVIDE_OVERFLOW; #else -- cgit v1.1