1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

signal.c: add sigprocmask guard

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-04-14 16:07:45 +00:00
parent 1e1a585300
commit f7b51fd28d

View file

@ -776,12 +776,16 @@ NORETURN(static void raise_stack_overflow(int sig, rb_thread_t *th));
static void static void
raise_stack_overflow(int sig, rb_thread_t *th) raise_stack_overflow(int sig, rb_thread_t *th)
{ {
#ifdef HAVE_SIGPROCMASK
sigset_t mask; sigset_t mask;
#endif
clear_received_signal(); clear_received_signal();
#ifdef HAVE_SIGPROCMASK
sigemptyset(&mask); sigemptyset(&mask);
sigaddset(&mask, sig); sigaddset(&mask, sig);
if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) if (sigprocmask(SIG_UNBLOCK, &mask, NULL))
rb_bug_errno("sigprocmask:set", errno); rb_bug_errno("sigprocmask:set", errno);
#endif
ruby_thread_stack_overflow(th); ruby_thread_stack_overflow(th);
} }