From eda396cc5f00c54b251397190b6f05c6d27f041c Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Sat, 10 Dec 2016 14:34:26 -0600 Subject: [PATCH] Add More Signals --- src/porting.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/porting.cpp b/src/porting.cpp index 023f0cca7..30826b43c 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -85,6 +85,22 @@ void signal_handler(int sig) dstream << "INFO: signal_handler(): " << "got SIGTERM, shutting down." << std::endl; } + else if (sig == SIGFPE) { + dstream << "INFO: signal_handler(): " + << "floating point exception, shutting down." << std::endl; + } + else if (sig == SIGSEGV) { + dstream << "INFO: signal_handler(): " + << "segmentation fault, shutting down." << std::endl; + } + else if (sig == SIGHUP) { + dstream << "INFO: signal_handler(): " + << "terminal hangup, shutting down." << std::endl; + } + else if (sig == SIGILL) { + dstream << "INFO: singal_handler(): " + << "illegal action, shutting down." << std::endl; + } // Comment out for less clutter when testing scripts /*dstream << "INFO: sigint_handler(): " @@ -101,6 +117,10 @@ void signal_handler_init(void) { (void)signal(SIGINT, signal_handler); (void)signal(SIGTERM, signal_handler); + (void)signal(SIGFPE, signal_handler); + (void)signal(SIGSEGV, signal_handler); + (void)signal(SIGHUP, signal_handler); + (void)signal(SIGILL, signal_handler); } #else // _WIN32