Only catch signals with a default action of "Core"

Close #59
This commit is contained in:
François-Xavier Bourlet 2017-03-15 17:01:35 -07:00 committed by GitHub
parent 8a576051ba
commit 5557e53f23

View File

@ -1869,33 +1869,20 @@ class SignalHandling {
public: public:
static std::vector<int> make_default_signals() { static std::vector<int> make_default_signals() {
const int posix_signals[] = { const int posix_signals[] = {
// default action: Core // Signals for which the default action is "Core".
SIGILL, SIGABRT, // Abort signal from abort(3)
SIGABRT, SIGBUS, // Bus error (bad memory access)
SIGFPE, SIGFPE, // Floating point exception
SIGSEGV, SIGILL, // Illegal Instruction
SIGBUS, SIGIOT, // IOT trap. A synonym for SIGABRT
// I am not sure the following signals should be enabled by SIGQUIT, // Quit from keyboard
// default: SIGSEGV, // Invalid memory reference
// default action: Term SIGSYS, // Bad argument to routine (SVr4)
SIGHUP, SIGTRAP, // Trace/breakpoint trap
SIGINT, SIGUNUSED, // Synonymous with SIGSYS
SIGPIPE, SIGXCPU, // CPU time limit exceeded (4.2BSD)
SIGALRM, SIGXFSZ, // File size limit exceeded (4.2BSD)
SIGTERM,
SIGUSR1,
SIGUSR2,
SIGPOLL,
SIGPROF,
SIGVTALRM,
SIGIO,
SIGPWR,
// default action: Core
SIGQUIT,
SIGSYS,
SIGTRAP,
SIGXCPU,
SIGXFSZ
}; };
return std::vector<int>(posix_signals, posix_signals + sizeof posix_signals / sizeof posix_signals[0] ); return std::vector<int>(posix_signals, posix_signals + sizeof posix_signals / sizeof posix_signals[0] );
} }