From 507b5ba7de4c325fe49cc3c64d0a3f991fd60b80 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 16 Apr 2004 07:12:05 +0000 Subject: [PATCH] make signalHandler work on DARWIN --- stepmania/src/archutils/Unix/SignalHandler.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/stepmania/src/archutils/Unix/SignalHandler.cpp b/stepmania/src/archutils/Unix/SignalHandler.cpp index 03bb011b9a..db26575e68 100644 --- a/stepmania/src/archutils/Unix/SignalHandler.cpp +++ b/stepmania/src/archutils/Unix/SignalHandler.cpp @@ -16,7 +16,7 @@ SaveSignals *saved_sigs; static int signals[] = { SIGALRM, SIGBUS, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGABRT, SIGQUIT, SIGSEGV, SIGTRAP, SIGTERM, SIGVTALRM, SIGXCPU, SIGXFSZ, -#if defined(HAVE_DECL_SIGPWR) && HAVE_DECL_SIGPWR +#if defined(HAVE_DECL_SIGPWR) SIGPWR, #endif -1 @@ -65,6 +65,7 @@ static int find_stack_direction() return find_stack_direction2( &c ); } +#if defined(LINUX) /* Create a stack with a barrier page at the end to guard against stack overflow. */ static void *CreateStack( int size ) { @@ -100,6 +101,7 @@ static void *CreateStack( int size ) return p; } +#endif /* Hook up events to fatal signals, so we can clean up if we're killed. */ void SignalHandler::OnClose(handler h) @@ -108,15 +110,17 @@ void SignalHandler::OnClose(handler h) { saved_sigs = new SaveSignals; - /* Allocate a separate signal stack. This makes the crash handler work - * if we run out of stack space. */ + void *p = NULL; + +#if defined(LINUX) /* Ugh. Signal stack + pthreads + Linux 2.4 = crash or hang. */ CString system; int version; GetKernel( system, version ); + /* Allocate a separate signal stack. This makes the crash handler work + * if we run out of stack space. */ const int AltStackSize = 1024*64; - void *p = NULL; if( version > 20500 ) p = CreateStack( AltStackSize ); @@ -132,6 +136,7 @@ void SignalHandler::OnClose(handler h) p = NULL; /* no SA_ONSTACK */ } } +#endif struct sigaction sa;