CRASH_HANDLER is always defined for OS X. Make sure that we _exit() after fatal signals. (Initialize the crash handler while I'm at it since that's likely to be needed for the x86 crash handler, which I can't really write without an x86.)
This commit is contained in:
@@ -37,7 +37,6 @@ static bool DoCleanShutdown( int signal, siginfo_t *si, const ucontext_t *uc )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CRASH_HANDLER)
|
|
||||||
static bool DoCrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc )
|
static bool DoCrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc )
|
||||||
{
|
{
|
||||||
/* Don't dump a debug file if the user just hit ^C. */
|
/* Don't dump a debug file if the user just hit ^C. */
|
||||||
@@ -47,17 +46,22 @@ static bool DoCrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *u
|
|||||||
CrashHandler::CrashSignalHandler( signal, si, uc );
|
CrashHandler::CrashSignalHandler( signal, si, uc );
|
||||||
return true; // Unreached
|
return true; // Unreached
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
static bool DoEmergencyShutdown( int signal, siginfo_t *si, const ucontext_t *us )
|
||||||
|
{
|
||||||
|
if( IsFatalSignal(signal) )
|
||||||
|
_exit( 1 ); // We ran the crash handler already
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void ArchHooks_darwin::Init()
|
void ArchHooks_darwin::Init()
|
||||||
{
|
{
|
||||||
/* First, handle non-fatal termination signals. */
|
/* First, handle non-fatal termination signals. */
|
||||||
SignalHandler::OnClose( DoCleanShutdown );
|
SignalHandler::OnClose( DoCleanShutdown );
|
||||||
|
|
||||||
#if defined(CRASH_HANDLER)
|
|
||||||
CrashHandler::CrashHandlerHandleArgs( g_argc, g_argv );
|
CrashHandler::CrashHandlerHandleArgs( g_argc, g_argv );
|
||||||
|
CrashHandler::InitializeCrashHandler();
|
||||||
SignalHandler::OnClose( DoCrashSignalHandler );
|
SignalHandler::OnClose( DoCrashSignalHandler );
|
||||||
#endif
|
SignalHandler::OnClose( DoEmergencyShutdown );
|
||||||
|
|
||||||
// CF*Copy* functions' return values need to be released, CF*Get* functions' do not.
|
// CF*Copy* functions' return values need to be released, CF*Get* functions' do not.
|
||||||
CFStringRef key = CFSTR( "ApplicationBundlePath" );
|
CFStringRef key = CFSTR( "ApplicationBundlePath" );
|
||||||
|
|||||||
Reference in New Issue
Block a user