summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-05 14:00:11 +0000
committernagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-11-05 14:00:11 +0000
commitea03c3fc2c0bfcf6351c3bce9496fd4607f4594a (patch)
tree6c121bf51ead591584872b4674497d233f7b37b5 /signal.c
parent4dada1c8a20c0fab0e058d7cd934c1c011617049 (diff)
configure.in, eval.c, signal.c: : add '--with-pthread-ext' option
to fix the pthread trouble on 'tcltklib' ext/tcltklib/README.1st: add the description of '--with-pthread-ext' ext/tk/lib/tktext.rb : add TkText#text_copy, text_cut, text_paste to support Tcl/Tk8.4's tk_textCopy, tk_textCut, tk_textPaste ext/tk/lib/tk.rb : add TkMenu#set_focus support Tcl/Tk's tk_menuSetFocus git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/signal.c b/signal.c
index 628fdc3fc6..4e489a73bb 100644
--- a/signal.c
+++ b/signal.c
@@ -706,6 +706,48 @@ install_sighandler(signum, handler)
}
}
+static void
+init_sigchld(sig)
+ int sig;
+{
+ sighandler_t oldfunc;
+#ifndef _WIN32
+# ifdef HAVE_SIGPROCMASK
+ sigset_t mask;
+# else
+ int mask;
+# endif
+#endif
+
+#ifndef _WIN32
+ /* disable interrupt */
+# ifdef HAVE_SIGPROCMASK
+ sigfillset(&mask);
+ sigprocmask(SIG_BLOCK, &mask, &mask);
+# else
+ mask = sigblock(~0);
+# endif
+#endif
+
+ oldfunc = ruby_signal(sig, SIG_DFL);
+ if (oldfunc != SIG_DFL && oldfunc != SIG_IGN) {
+ ruby_signal(sig, oldfunc);
+ } else {
+ trap_list[sig] = 0;
+ }
+
+#ifndef _WIN32
+#ifdef HAVE_SIGPROCMASK
+ sigdelset(&mask, sig);
+ sigprocmask(SIG_SETMASK, &mask, NULL);
+#else
+ mask &= ~sigmask(sig);
+ sigsetmask(mask);
+#endif
+ trap_last_mask = mask;
+#endif
+}
+
void
Init_signal()
{
@@ -742,5 +784,13 @@ Init_signal()
#ifdef SIGPIPE
install_sighandler(SIGPIPE, sigpipe);
#endif
+
+#ifdef SIGCLD
+ init_sigchld(SIGCLD);
+#endif
+#ifdef SIGCHLD
+ init_sigchld(SIGCHLD);
+#endif
+
#endif /* MACOS_UNUSE_SIGNAL */
}