summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-11-17 08:11:24 +0000
committertron <tron@openttd.org>2004-11-17 08:11:24 +0000
commit0086bb9d0678876e2e3e9b4002a0f44af2c45ee4 (patch)
treec288f182a2c021fc00a5d898252c802059ee187c
parent2760ed80fdd4c7ff2847ea0a02c24258d53cf360 (diff)
downloadopenttd-0086bb9d0678876e2e3e9b4002a0f44af2c45ee4.tar.xz
(svn r653) Prevent SDL parachute from catching SIGSEGV and SIGFPE (pasky)
-rw-r--r--sdl.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sdl.c b/sdl.c
index a9869603d..596807a4b 100644
--- a/sdl.c
+++ b/sdl.c
@@ -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
}
}