summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--signal.c13
2 files changed, 13 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 6f7b9d2768..d55ef42ea2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
+Fri Jun 15 18:56:52 2007 Tanaka Akira <akr@fsij.org>
+
+ * signal.c (trap_handler): trap("SIGSEGV", "DEFAULT") may cause wrong
+ trap error because SIG_DFL may be zero.
+
Fri Jun 15 15:55:55 2007 Koichi Sasada <ko1@atdot.net>
- * insns.def(setconstant, toregexp): fix to mark object correctly.
+ * insns.def (setconstant, toregexp): fix to mark object correctly.
Fri Jun 15 13:24:18 2007 Koichi Sasada <ko1@atdot.net>
diff --git a/signal.c b/signal.c
index 3f104b1854..ddb8dd97d3 100644
--- a/signal.c
+++ b/signal.c
@@ -634,10 +634,15 @@ struct trap_arg {
VALUE cmd;
};
+static RETSIGTYPE
+wrong_trap(int sig)
+{
+}
+
static sighandler_t
trap_handler(VALUE *cmd)
{
- sighandler_t func = 0;
+ sighandler_t func = wrong_trap;
VALUE command;
if (NIL_P(*cmd)) {
@@ -674,7 +679,7 @@ trap_handler(VALUE *cmd)
}
break;
}
- if (!func) {
+ if (func == wrong_trap) {
rb_raise(rb_eArgError, "wrong trap - %s", RSTRING_PTR(command));
}
}
@@ -1047,14 +1052,10 @@ Init_signal(void)
#endif
#ifdef SIGBUS
-# ifndef RUBY_GC_STRESS
install_sighandler(SIGBUS, sigbus);
-# endif
#endif
#ifdef SIGSEGV
-# ifndef RUBY_GC_STRESS
install_sighandler(SIGSEGV, sigsegv);
-# endif
#endif
#ifdef SIGPIPE
install_sighandler(SIGPIPE, sigpipe);