From f2c2fb5ac4929395885ae349231de49d62e2fde4 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 25 Feb 2002 09:16:25 +0000 Subject: * eval.c (method_inspect): should not dump core for unbound singleton methods. * object.c (rb_mod_to_s): better description. * hash.c (env_select): should path the assoc list. * process.c (rb_syswait): thread kludge; should be fixed to support native thread. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'process.c') diff --git a/process.c b/process.c index 8da595357..7f1375dd3 100644 --- a/process.c +++ b/process.c @@ -768,29 +768,36 @@ void rb_syswait(pid) int pid; { + static int overriding; RETSIGTYPE (*hfunc)_((int)), (*qfunc)_((int)), (*ifunc)_((int)); int status; - int i; + int i, hooked = Qfalse; + if (!overriding) { #ifdef SIGHUP - hfunc = signal(SIGHUP, SIG_IGN); + hfunc = signal(SIGHUP, SIG_IGN); #endif #ifdef SIGQUIT - qfunc = signal(SIGQUIT, SIG_IGN); + qfunc = signal(SIGQUIT, SIG_IGN); #endif - ifunc = signal(SIGINT, SIG_IGN); + ifunc = signal(SIGINT, SIG_IGN); + overriding = Qtrue; + hooked = Qtrue; + } do { i = rb_waitpid(pid, &status, 0); } while (i == -1 && errno == EINTR); + if (hooked) { #ifdef SIGHUP - signal(SIGHUP, hfunc); + signal(SIGHUP, hfunc); #endif #ifdef SIGQUIT - signal(SIGQUIT, qfunc); + signal(SIGQUIT, qfunc); #endif - signal(SIGINT, ifunc); + signal(SIGINT, ifunc); + } } static VALUE -- cgit