summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 7fc2069a6ff..57f68fe44b1 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 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