signal handling fixes
This commit is contained in:
@@ -19,9 +19,9 @@ static bool IsFatalSignal( int signal )
|
|||||||
case SIGINT:
|
case SIGINT:
|
||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,12 +53,6 @@ static void EmergencyShutdown( int signal )
|
|||||||
* another thread causes crashes (eg. GL may be using TLS). */
|
* another thread causes crashes (eg. GL may be using TLS). */
|
||||||
if( !strcmp(RageThread::GetCurThreadName(), "Main thread") && SDL_WasInit(SDL_INIT_VIDEO) )
|
if( !strcmp(RageThread::GetCurThreadName(), "Main thread") && SDL_WasInit(SDL_INIT_VIDEO) )
|
||||||
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
SDL_QuitSubSystem(SDL_INIT_VIDEO);
|
||||||
}
|
|
||||||
|
|
||||||
static void KillSelf( int signal )
|
|
||||||
{
|
|
||||||
if( !IsFatalSignal(signal) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
kill( 0, SIGKILL );
|
kill( 0, SIGKILL );
|
||||||
}
|
}
|
||||||
@@ -71,15 +65,12 @@ ArchHooks_Unix::ArchHooks_Unix()
|
|||||||
#if defined(CRASH_HANDLER)
|
#if defined(CRASH_HANDLER)
|
||||||
CrashHandlerHandleArgs( g_argc, g_argv );
|
CrashHandlerHandleArgs( g_argc, g_argv );
|
||||||
InitializeCrashHandler();
|
InitializeCrashHandler();
|
||||||
SignalHandler::OnClose( CrashSignalHandler );
|
SignalHandler::OnClose( DoCrashSignalHandler );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set up EmergencyShutdown, to try to shut down the window if we crash.
|
/* Set up EmergencyShutdown, to try to shut down the window if we crash.
|
||||||
* This might blow up, so be sure to do it after the crash handler. */
|
* This might blow up, so be sure to do it after the crash handler. */
|
||||||
SignalHandler::OnClose( EmergencyShutdown );
|
SignalHandler::OnClose( EmergencyShutdown );
|
||||||
|
|
||||||
/* On fatal crashes, after the above, kill ourself so we don't return. */
|
|
||||||
SignalHandler::OnClose( KillSelf );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArchHooks_Unix::DumpDebugInfo()
|
void ArchHooks_Unix::DumpDebugInfo()
|
||||||
|
|||||||
Reference in New Issue
Block a user