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
handleSignal(int signal, siginfo_t* info, void* context)
handleSignal(int signal, siginfo_t*, void* context)
{
ucontext_t* c = static_cast<ucontext_t*>(context);
@ -943,13 +943,6 @@ handleSignal(int signal, siginfo_t* info, void* context)
default: abort();
}
if (system->oldHandlers[index].sa_flags & SA_SIGINFO
and system->oldHandlers[index].sa_sigaction)
{
system->oldHandlers[index].sa_sigaction(signal, info, context);
} else if (system->oldHandlers[index].sa_handler) {
system->oldHandlers[index].sa_handler(signal);
} else {
switch (signal) {
case VisitSignal:
case InterruptSignal:
@ -959,7 +952,6 @@ handleSignal(int signal, siginfo_t* info, void* context)
default:
abort();
}
}
}
} // namespace