mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* signal.c (sig_trap): avoid pthread_sigmask(xx, &mask, &mask) usage
because FreeBSD don't permit it. If it's used, it behave as pthread_sigmask(xx, NULL, &mask). * signal.c (init_sigchld): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4250c745ca
commit
df52785d30
2 changed files with 20 additions and 6 deletions
|
@ -1,3 +1,11 @@
|
|||
Sun Feb 20 02:14:09 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* signal.c (sig_trap): avoid pthread_sigmask(xx, &mask, &mask) usage
|
||||
because FreeBSD don't permit it. If it's used, it behave as
|
||||
pthread_sigmask(xx, NULL, &mask).
|
||||
|
||||
* signal.c (init_sigchld): ditto.
|
||||
|
||||
Sun Feb 20 00:46:51 2011 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* ext/openssl/ossl_bn.c: parenthesize macro arguments.
|
||||
|
|
18
signal.c
18
signal.c
|
@ -964,11 +964,15 @@ sig_trap(int argc, VALUE *argv)
|
|||
rb_raise(rb_eSecurityError, "Insecure: tainted signal trap");
|
||||
}
|
||||
#if USE_TRAP_MASK
|
||||
/* disable interrupt */
|
||||
sigfillset(&arg.mask);
|
||||
pthread_sigmask(SIG_BLOCK, &arg.mask, &arg.mask);
|
||||
{
|
||||
sigset_t fullmask;
|
||||
|
||||
return rb_ensure(trap, (VALUE)&arg, trap_ensure, (VALUE)&arg);
|
||||
/* disable interrupt */
|
||||
sigfillset(&fullmask);
|
||||
pthread_sigmask(SIG_BLOCK, &fullmask, &arg.mask);
|
||||
|
||||
return rb_ensure(trap, (VALUE)&arg, trap_ensure, (VALUE)&arg);
|
||||
}
|
||||
#else
|
||||
return trap(&arg);
|
||||
#endif
|
||||
|
@ -1014,15 +1018,17 @@ init_sigchld(int sig)
|
|||
#if USE_TRAP_MASK
|
||||
# ifdef HAVE_SIGPROCMASK
|
||||
sigset_t mask;
|
||||
sigset_t fullmask;
|
||||
# else
|
||||
int mask;
|
||||
int fullmask;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if USE_TRAP_MASK
|
||||
/* disable interrupt */
|
||||
sigfillset(&mask);
|
||||
pthread_sigmask(SIG_BLOCK, &mask, &mask);
|
||||
sigfillset(&fullmask);
|
||||
pthread_sigmask(SIG_BLOCK, &fullmask, &mask);
|
||||
#endif
|
||||
|
||||
oldfunc = ruby_signal(sig, SIG_DFL);
|
||||
|
|
Loading…
Add table
Reference in a new issue