diff --git a/ChangeLog b/ChangeLog index 0515a7f975..fa136d9159 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu May 29 23:27:50 2014 Rei Odaira + + * 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] + Thu May 29 23:11:20 2014 Tanaka Akira * io.c (pipe_open): Close pipes when rb_execarg_fixup() raises diff --git a/signal.c b/signal.c index 8e84db5874..75908420ef 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