From fd848f2b0c810d7d817ca0177dfc82e1beb5c5e2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 6 May 2004 08:41:34 +0000 Subject: [PATCH] fix compile when !CRASH_HANDLER fix core dumping when !CRASH_HANDLER --- stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp b/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp index 0b1c5f47d2..47089cc5bb 100644 --- a/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp +++ b/stepmania/src/arch/ArchHooks/ArchHooks_Unix.cpp @@ -37,6 +37,7 @@ static void DoCleanShutdown( int signal, siginfo_t *si, const ucontext_t *uc ) ExitGame(); } +#if defined(CRASH_HANDLER) static void DoCrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *uc ) { /* Don't dump a debug file if the user just hit ^C. */ @@ -45,6 +46,7 @@ static void DoCrashSignalHandler( int signal, siginfo_t *si, const ucontext_t *u CrashSignalHandler( signal, si, uc ); } +#endif static void EmergencyShutdown( int signal, siginfo_t *si, const ucontext_t *uc ) { @@ -57,7 +59,14 @@ static void EmergencyShutdown( int signal, siginfo_t *si, const ucontext_t *uc ) if( !strcmp(RageThread::GetCurThreadName(), "Main thread") && SDL_WasInit(SDL_INIT_VIDEO) ) SDL_QuitSubSystem(SDL_INIT_VIDEO); +#if defined(CRASH_HANDLER) + /* If we ran the crash handler, then die. */ kill( getpid(), SIGKILL ); +#else + /* We didn't run the crash handler. Run the default handler, so we can dump core. */ + SignalHandler::ResetSignalHandlers(); + raise( signal ); +#endif } ArchHooks_Unix::ArchHooks_Unix()