diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-20 14:32:16 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-08-20 14:32:16 +0000 |
commit | ab79053868e99d47cf38fc1c8b2f3aa7a0396452 (patch) | |
tree | 0f0961327cbca972ac26d251678fc862ba6d927a /libjava/prims.cc | |
parent | 79bdd5ffbdff5ef603a8d4ddac847c6cf0784592 (diff) | |
download | gcc-ab79053868e99d47cf38fc1c8b2f3aa7a0396452.tar.gz |
2003-08-19 Andrew Haley <aph@redhat.com>
* prims.cc (unblock_signal): New function.
(SIGNAL_HANDLER): Use it.
(SIGNAL_HANDLER): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70598 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r-- | libjava/prims.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc index 9f8477334da..8208995460e 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 |