summaryrefslogtreecommitdiff
path: root/signal.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 14:27:53 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-29 14:27:53 (GMT)
commitfad56622f7aef6ed82339852b3a4aea3cabe6430 (patch)
tree22890f3c48725602abdaa8f3405d34ddf0fa83c7 /signal.c
parent52e91e0f721057d133b2020c10a3abe390fc1732 (diff)
signal.c: return proper member
* signal.c (ruby_signal): should return either `old.sa_sigaction` or `old.sa_handler`, depending on whether `SA_SIGINFO` is set in `old.sa_flags`, because they may not be a union. [ruby-core:62836] [Bug #9878] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/signal.c b/signal.c
index 8e84db5..7590842 100644
--- a/signal.c
+++ b/signal.c
@@ -595,7 +595,10 @@ ruby_signal(int signum, sighandler_t handler)
rb_bug_errno("sigaction", errno);
}
}
- return old.sa_handler;
+ if (old.sa_flags & SA_SIGINFO)
+ return (sighandler_t)old.sa_sigaction;
+ else
+ return old.sa_handler;
}
sighandler_t