summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 15:50:24 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 15:50:24 (GMT)
commit99acd378d82d60d446ef12ccdaa332ef29df3243 (patch)
treef2843a1f95940bc33da9d8725692463d25e17022 /signal.c
parentd1f332d16a282b579a9edd144a9eb2cfc1d6115e (diff)
* signal.c (ruby_signal): Don't set SA_SIGINFO for SIG_IGN and
SIG_DFL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/signal.c b/signal.c
index e723e66..3faa267 100644
--- a/signal.c
+++ b/signal.c
@@ -569,8 +569,14 @@ ruby_signal(int signum, sighandler_t handler)
sigemptyset(&sigact.sa_mask);
#ifdef USE_SIGALTSTACK
- sigact.sa_sigaction = (ruby_sigaction_t*)handler;
- sigact.sa_flags = SA_SIGINFO;
+ if (handler == SIG_IGN || handler == SIG_DFL) {
+ sigact.sa_handler = handler;
+ sigact.sa_flags = 0;
+ }
+ else {
+ sigact.sa_sigaction = (ruby_sigaction_t*)handler;
+ sigact.sa_flags = SA_SIGINFO;
+ }
#else
sigact.sa_handler = handler;
sigact.sa_flags = 0;