Skip to content
Browse files

don't install stupid handlers on some signals

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@2677 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 7ec3d60 commit 153d14596fe88b394b0f2dcbb88d1185f1cba26b Laurent Sansonetti committed Sep 29, 2009
Showing with 12 additions and 19 deletions.
  1. +1 −1 TODO
  2. +11 −18 signal.c
View
2 TODO
@@ -39,7 +39,7 @@ For 0.5 (must do):
[/] port all rb_obj_respond_to() calls to rb_vm_respond_to()
[X] refresh copyright headers for 2009
[ ] rdoc should work
-[ ] MacRuby should not ignore SIGINT
+[X] MacRuby should not ignore SIGINT and other signals
For 0.5 (tentative):
View
29 signal.c
@@ -11,6 +11,8 @@
**********************************************************************/
+// TODO: rewrite me!
+
#include "ruby/ruby.h"
#include "ruby/signal.h"
#include "ruby/node.h"
@@ -429,7 +431,6 @@ rb_gc_mark_trap_list(void)
typedef RETSIGTYPE (*sighandler_t)(int);
-#ifdef POSIX_SIGNAL
static sighandler_t
ruby_signal(int signum, sighandler_t handler)
{
@@ -462,21 +463,6 @@ posix_signal(int signum, sighandler_t handler)
return ruby_signal(signum, handler);
}
-#else /* !POSIX_SIGNAL */
-#define ruby_signal(sig,handler) (/* rb_trap_accept_nativethreads[sig] = 0,*/ signal((sig),(handler)))
-#if 0 /* def HAVE_NATIVETHREAD */
-static sighandler_t
-ruby_nativethread_signal(int signum, sighandler_t handler)
-{
- sighandler_t old;
-
- old = signal(signum, handler);
- rb_trap_accept_nativethreads[signum] = 1;
- return old;
-}
-#endif
-#endif
-
static RETSIGTYPE
sighandler(int sig)
{
@@ -486,9 +472,12 @@ sighandler(int sig)
ATOMIC_INC(vm->buffered_signal_size);
#endif
-#if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL)
+printf("sighandler %d\n", sig);
+
+//#if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL)
+printf("ruby signal\n");
ruby_signal(sig, sighandler);
-#endif
+//#endif
}
#if USE_TRAP_MASK
@@ -973,6 +962,7 @@ sig_list(VALUE rcv, SEL sel)
return h;
}
+#if 0
static void
install_sighandler(int signum, sighandler_t handler)
{
@@ -983,6 +973,7 @@ install_sighandler(int signum, sighandler_t handler)
ruby_signal(signum, old);
}
}
+#endif
#if defined(SIGCLD) || defined(SIGCHLD)
static void
@@ -1095,6 +1086,7 @@ Init_signal(void)
rb_alias(rb_eSignal, rb_intern("signm"), rb_intern("message"));
rb_objc_define_method(rb_eInterrupt, "initialize", interrupt_init, -1);
+#if 0
install_sighandler(SIGINT, sighandler);
#ifdef SIGHUP
install_sighandler(SIGHUP, sighandler);
@@ -1129,6 +1121,7 @@ Init_signal(void)
#ifdef SIGPIPE
install_sighandler(SIGPIPE, sigpipe);
#endif
+#endif
#if defined(SIGCLD)
init_sigchld(SIGCLD);

0 comments on commit 153d145

Please sign in to comment.
Something went wrong with that request. Please try again.