diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | signal.c | 13 |
2 files changed, 13 insertions, 7 deletions
@@ -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> @@ -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); |