diff options
Diffstat (limited to 'sysdeps/mach/hurd/i386/trampoline.c')
-rw-r--r-- | sysdeps/mach/hurd/i386/trampoline.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sysdeps/mach/hurd/i386/trampoline.c b/sysdeps/mach/hurd/i386/trampoline.c index 2a0783a586..2ff3c406c5 100644 --- a/sysdeps/mach/hurd/i386/trampoline.c +++ b/sysdeps/mach/hurd/i386/trampoline.c @@ -90,7 +90,7 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, void firewall (void); extern const void _hurd_intr_rpc_msg_cx_sp; extern const void _hurd_intr_rpc_msg_sp_restored; - struct sigaction *action; + const struct sigaction *action; void *volatile sigsp; struct sigcontext *scp; struct @@ -123,6 +123,11 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, siginfo_t siginfo; } *stackframe; + /* sigaction for preemptors */ + static const struct sigaction legacy_sigaction = { + .sa_flags = SA_RESTART + }; + if (ss->context) { /* We have a previous sigcontext that sigreturn was about @@ -146,9 +151,13 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, __sighandler_t handler, interrupted RPC frame. */ state->basic.esp = state->basic.uesp; - /* XXX what if handler != action->handler (for instance, if a signal - * preemptor took over) ? */ action = & _hurd_sigstate_actions (ss) [signo]; + if ( (action->sa_flags & SA_SIGINFO) + && handler != (__sighandler_t) action->sa_sigaction + || !(action->sa_flags & SA_SIGINFO) + && handler != action->sa_handler) + /* A signal preemptor took over, use legacy semantic. */ + action = &legacy_sigaction; if ((action->sa_flags & SA_ONSTACK) && !(ss->sigaltstack.ss_flags & (SS_DISABLE|SS_ONSTACK))) |