don't defer to previous handler in signal handler

It isn't necessarily safe or desireable to call the previous handler
even if it's non-null, so we ignore it entirely except to reinstate it
when unregistering our own handler.
This commit is contained in:
Joel Dice 2011-03-17 21:32:37 -06:00
parent 86733a25f4
commit 8a28578ef5

View File

@ -865,7 +865,7 @@ class MySystem: public System {
}; };
void void
handleSignal(int signal, siginfo_t* info, void* context) handleSignal(int signal, siginfo_t*, void* context)
{ {
ucontext_t* c = static_cast<ucontext_t*>(context); ucontext_t* c = static_cast<ucontext_t*>(context);
@ -943,22 +943,14 @@ handleSignal(int signal, siginfo_t* info, void* context)
default: abort(); default: abort();
} }
if (system->oldHandlers[index].sa_flags & SA_SIGINFO switch (signal) {
and system->oldHandlers[index].sa_sigaction) case VisitSignal:
{ case InterruptSignal:
system->oldHandlers[index].sa_sigaction(signal, info, context); case PipeSignal:
} else if (system->oldHandlers[index].sa_handler) { break;
system->oldHandlers[index].sa_handler(signal);
} else {
switch (signal) {
case VisitSignal:
case InterruptSignal:
case PipeSignal:
break;
default: default:
abort(); abort();
}
} }
} }