From ea03c3fc2c0bfcf6351c3bce9496fd4607f4594a Mon Sep 17 00:00:00 2001 From: nagai Date: Wed, 5 Nov 2003 14:00:11 +0000 Subject: 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 --- signal.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'signal.c') 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 */ } -- cgit v1.2.3