[macruby-changes] [2677] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Tue Sep 29 14:12:14 PDT 2009
Revision: 2677
http://trac.macosforge.org/projects/ruby/changeset/2677
Author: lsansonetti at apple.com
Date: 2009-09-29 14:12:11 -0700 (Tue, 29 Sep 2009)
Log Message:
-----------
don't install stupid handlers on some signals
Modified Paths:
--------------
MacRuby/trunk/TODO
MacRuby/trunk/signal.c
Modified: MacRuby/trunk/TODO
===================================================================
--- MacRuby/trunk/TODO 2009-09-29 09:12:13 UTC (rev 2676)
+++ MacRuby/trunk/TODO 2009-09-29 21:12:11 UTC (rev 2677)
@@ -39,7 +39,7 @@
[/] 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):
Modified: MacRuby/trunk/signal.c
===================================================================
--- MacRuby/trunk/signal.c 2009-09-29 09:12:13 UTC (rev 2676)
+++ MacRuby/trunk/signal.c 2009-09-29 21:12:11 UTC (rev 2677)
@@ -11,6 +11,8 @@
**********************************************************************/
+// TODO: rewrite me!
+
#include "ruby/ruby.h"
#include "ruby/signal.h"
#include "ruby/node.h"
@@ -429,7 +431,6 @@
typedef RETSIGTYPE (*sighandler_t)(int);
-#ifdef POSIX_SIGNAL
static sighandler_t
ruby_signal(int signum, sighandler_t handler)
{
@@ -462,21 +463,6 @@
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 @@
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 @@
return h;
}
+#if 0
static void
install_sighandler(int signum, sighandler_t handler)
{
@@ -983,6 +973,7 @@
ruby_signal(signum, old);
}
}
+#endif
#if defined(SIGCLD) || defined(SIGCHLD)
static void
@@ -1095,6 +1086,7 @@
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 @@
#ifdef SIGPIPE
install_sighandler(SIGPIPE, sigpipe);
#endif
+#endif
#if defined(SIGCLD)
init_sigchld(SIGCLD);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090929/50e6e14e/attachment.html>
More information about the macruby-changes
mailing list