Skip to content
Snippets Groups Projects
Commit b081c5c3 authored by tumbili's avatar tumbili
Browse files

added signal handler for floating point exceptions

parent ec1d148b
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,13 @@ extern "C" {
cout.flush();
_exit(0);
}
void _SigFpeHandler(int sig_num);
void _SigFpeHandler(int sig_num)
{
cout.flush();
cout << endl << "floating point exception" << endl;
cout.flush();
}
}
static void print_prompt()
......@@ -137,6 +144,7 @@ int main(int argc, char **argv)
{
bool daemon_mode = false;
signal(SIGINT, _SigIntHandler);
signal(SIGFPE, _SigFpeHandler);
int index = 1;
bool error_detected = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment