aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2003-08-20 14:32:16 +0000
committerAndrew Haley <aph@gcc.gnu.org>2003-08-20 14:32:16 +0000
commit2510de8d0bcb4ced7652762cbdcbe3fd624519e4 (patch)
tree0f0961327cbca972ac26d251678fc862ba6d927a /libjava
parent3acef2ae63e40303a73a7559939689c397c0450d (diff)
downloadgcc-2510de8d0bcb4ced7652762cbdcbe3fd624519e4.zip
gcc-2510de8d0bcb4ced7652762cbdcbe3fd624519e4.tar.gz
gcc-2510de8d0bcb4ced7652762cbdcbe3fd624519e4.tar.bz2
prims.cc (unblock_signal): New function.
2003-08-19 Andrew Haley <aph@redhat.com> * prims.cc (unblock_signal): New function. (SIGNAL_HANDLER): Use it. (SIGNAL_HANDLER): Likewise. From-SVN: r70598
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/prims.cc16
2 files changed, 22 insertions, 0 deletions
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 <aph@redhat.com>
+
+ * prims.cc (unblock_signal): New function.
+ (SIGNAL_HANDLER): Use it.
+ (SIGNAL_HANDLER): Likewise.
+
2003-08-19 Danny Smith <dannysmith@users.sourceforge.net>
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