Commit 6ce01477 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Check if SIGPWR is defined, for systems that don't support it (ie. MacOSX).

parent 1e9d11d1
...@@ -673,9 +673,11 @@ void catch_sig_stop(int sig_num) ...@@ -673,9 +673,11 @@ void catch_sig_stop(int sig_num)
case SIGHUP: case SIGHUP:
std::cerr << "SIGHUP (Hangup)."; std::cerr << "SIGHUP (Hangup).";
break; break;
#ifdef SIGPWR
case SIGPWR: case SIGPWR:
std::cerr << "SIGPWR (Power failure restart)."; std::cerr << "SIGPWR (Power failure restart).";
break; break;
std::cerr << "SIGSEGV (Segmentation fault). " std::cerr << "SIGSEGV (Segmentation fault). "
<< "There's a bug somewhere in the program. Go fix it."; << "There's a bug somewhere in the program. Go fix it.";
...@@ -710,7 +712,9 @@ void GraphInterface::InitSignalHandling() ...@@ -710,7 +712,9 @@ void GraphInterface::InitSignalHandling()
signal(SIGTERM, catch_sig_stop); signal(SIGTERM, catch_sig_stop);
signal(SIGQUIT, catch_sig_stop); signal(SIGQUIT, catch_sig_stop);
signal(SIGHUP, catch_sig_stop); signal(SIGHUP, catch_sig_stop);
#ifdef SIGPWR
signal(SIGPWR, catch_sig_stop); signal(SIGPWR, catch_sig_stop);
signal(SIGSEGV, catch_sig_stop); signal(SIGSEGV, catch_sig_stop);
signal(SIGBUS, catch_sig_stop); signal(SIGBUS, catch_sig_stop);
signal(SIGFPE, catch_sig_stop); signal(SIGFPE, catch_sig_stop);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment