mirror of https://github.com/AxioDL/logvisor.git
Handle SIGABRT
This commit is contained in:
parent
b229c2f8fe
commit
f913fb8479
|
@ -187,7 +187,8 @@ void logvisorAbort()
|
||||||
}
|
}
|
||||||
|
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
abort();
|
fflush(stdout);
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -202,6 +203,8 @@ static void AbortHandler(int signum)
|
||||||
Log.report(logvisor::Fatal, "Bad Execution");
|
Log.report(logvisor::Fatal, "Bad Execution");
|
||||||
case SIGFPE:
|
case SIGFPE:
|
||||||
Log.report(logvisor::Fatal, "Floating Point Exception");
|
Log.report(logvisor::Fatal, "Floating Point Exception");
|
||||||
|
case SIGABRT:
|
||||||
|
Log.report(logvisor::Fatal, "Abort Signal");
|
||||||
default:
|
default:
|
||||||
Log.report(logvisor::Fatal, "unknown signal %d", signum);
|
Log.report(logvisor::Fatal, "unknown signal %d", signum);
|
||||||
}
|
}
|
||||||
|
@ -452,6 +455,7 @@ void CreateWin32Console()
|
||||||
|
|
||||||
void RegisterStandardExceptions()
|
void RegisterStandardExceptions()
|
||||||
{
|
{
|
||||||
|
signal(SIGABRT, AbortHandler);
|
||||||
signal(SIGSEGV, AbortHandler);
|
signal(SIGSEGV, AbortHandler);
|
||||||
signal(SIGILL, AbortHandler);
|
signal(SIGILL, AbortHandler);
|
||||||
signal(SIGFPE, AbortHandler);
|
signal(SIGFPE, AbortHandler);
|
||||||
|
|
Loading…
Reference in New Issue