diff options
author | tron <tron@openttd.org> | 2004-11-17 08:11:24 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-11-17 08:11:24 +0000 |
commit | 0086bb9d0678876e2e3e9b4002a0f44af2c45ee4 (patch) | |
tree | c288f182a2c021fc00a5d898252c802059ee187c | |
parent | 2760ed80fdd4c7ff2847ea0a02c24258d53cf360 (diff) | |
download | openttd-0086bb9d0678876e2e3e9b4002a0f44af2c45ee4.tar.xz |
(svn r653) Prevent SDL parachute from catching SIGSEGV and SIGFPE (pasky)
-rw-r--r-- | sdl.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -119,6 +119,17 @@ static void SdlAbort(int sig) { /* Own hand-made parachute for the cases of failed assertions. */ SDL_CALL SDL_Quit(); + + switch (sig) { + case SIGSEGV: + case SIGFPE: + signal(sig, SIG_DFL); + raise(sig); + break; + + default: + break; + } } #endif @@ -141,6 +152,8 @@ static char *SdlOpen(uint32 x) #ifdef UNIX signal(SIGABRT, SdlAbort); + signal(SIGSEGV, SdlAbort); + signal(SIGFPE, SdlAbort); #endif return NULL; @@ -154,6 +167,8 @@ static void SdlClose(uint32 x) SDL_CALL SDL_Quit(); #ifdef UNIX signal(SIGABRT, SIG_DFL); + signal(SIGSEGV, SIG_DFL); + signal(SIGFPE, SIG_DFL); #endif } } |