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>
|
Sun Feb 20 00:46:51 2011 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/openssl/ossl_bn.c: parenthesize macro arguments.
|
* 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");
|
rb_raise(rb_eSecurityError, "Insecure: tainted signal trap");
|
||||||
}
|
}
|
||||||
#if USE_TRAP_MASK
|
#if USE_TRAP_MASK
|
||||||
/* disable interrupt */
|
{
|
||||||
sigfillset(&arg.mask);
|
sigset_t fullmask;
|
||||||
pthread_sigmask(SIG_BLOCK, &arg.mask, &arg.mask);
|
|
||||||
|
|
||||||
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
|
#else
|
||||||
return trap(&arg);
|
return trap(&arg);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1014,15 +1018,17 @@ init_sigchld(int sig)
|
||||||
#if USE_TRAP_MASK
|
#if USE_TRAP_MASK
|
||||||
# ifdef HAVE_SIGPROCMASK
|
# ifdef HAVE_SIGPROCMASK
|
||||||
sigset_t mask;
|
sigset_t mask;
|
||||||
|
sigset_t fullmask;
|
||||||
# else
|
# else
|
||||||
int mask;
|
int mask;
|
||||||
|
int fullmask;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_TRAP_MASK
|
#if USE_TRAP_MASK
|
||||||
/* disable interrupt */
|
/* disable interrupt */
|
||||||
sigfillset(&mask);
|
sigfillset(&fullmask);
|
||||||
pthread_sigmask(SIG_BLOCK, &mask, &mask);
|
pthread_sigmask(SIG_BLOCK, &fullmask, &mask);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
oldfunc = ruby_signal(sig, SIG_DFL);
|
oldfunc = ruby_signal(sig, SIG_DFL);
|
||||||
|
|
Loading…
Add table
Reference in a new issue