Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
kosaki committed Jul 12, 2011
1 parent c307523 commit 7fd8266
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions signal.c
Expand Up @@ -1021,31 +1021,15 @@ static void
init_sigchld(int sig)
{
sighandler_t oldfunc;
#if USE_TRAP_MASK
sigset_t mask;
sigset_t fullmask;

/*
* disable interrupt. Otherwise following temmporal signal handler change
* has a race.
* Note: now we have only single thread, therefore both sigprocmask() and
* pthread_sigmask() makes the same effect.
*/
sigfillset(&fullmask);
pthread_sigmask(SIG_BLOCK, &fullmask, &mask);
#endif

rb_disable_interrupt();
oldfunc = ruby_signal(sig, SIG_DFL);
if (oldfunc != SIG_DFL && oldfunc != SIG_IGN) {
ruby_signal(sig, oldfunc);
} else {
GET_VM()->trap_list[sig].cmd = 0;
}

#if USE_TRAP_MASK
sigdelset(&mask, sig);
pthread_sigmask(SIG_SETMASK, &mask, NULL);
#endif
rb_enable_interrupt();
}
#endif

Expand Down

0 comments on commit 7fd8266

Please sign in to comment.