ruby-changes:18894
From: kosaki <ko1@a...>
Date: Sun, 20 Feb 2011 03:14:37 +0900 (JST)
Subject: [ruby-changes:18894] Ruby:r30919 (trunk): * signal.c (sig_trap): avoid pthread_sigmask(xx, &mask, &mask) usage
kosaki 2011-02-20 03:14:30 +0900 (Sun, 20 Feb 2011) New Revision: 30919 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30919 Log: * 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. Modified files: trunk/ChangeLog trunk/signal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30918) +++ ChangeLog (revision 30919) @@ -1,3 +1,11 @@ +Sun Feb 20 02:14:09 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * 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@f...> * ext/openssl/ossl_bn.c: parenthesize macro arguments. Index: signal.c =================================================================== --- signal.c (revision 30918) +++ signal.c (revision 30919) @@ -964,11 +964,15 @@ 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 @@ #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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/