Commit 4b70200b authored by Ryan C. Gordon's avatar Ryan C. Gordon

Work on systems without sa_sigaction.

parent 1a862ae6
...@@ -236,6 +236,8 @@ if test x$enable_libc = xyes; then ...@@ -236,6 +236,8 @@ if test x$enable_libc = xyes; then
AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"]) AC_CHECK_LIB(iconv, iconv_open, [LIBS="$LIBS -liconv"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
AC_CHECK_FUNCS(iconv) AC_CHECK_FUNCS(iconv)
AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
fi fi
AC_CHECK_SIZEOF(void*) AC_CHECK_SIZEOF(void*)
......
...@@ -139,6 +139,7 @@ ...@@ -139,6 +139,7 @@
#undef HAVE_SINF #undef HAVE_SINF
#undef HAVE_SQRT #undef HAVE_SQRT
#undef HAVE_SIGACTION #undef HAVE_SIGACTION
#undef HAVE_SA_SIGACTION
#undef HAVE_SETJMP #undef HAVE_SETJMP
#undef HAVE_NANOSLEEP #undef HAVE_NANOSLEEP
#undef HAVE_SYSCONF #undef HAVE_SYSCONF
......
...@@ -49,12 +49,21 @@ SDL_QuitInit(void) ...@@ -49,12 +49,21 @@ SDL_QuitInit(void)
#ifdef HAVE_SIGACTION #ifdef HAVE_SIGACTION
struct sigaction action; struct sigaction action;
sigaction(SIGINT, NULL, &action); sigaction(SIGINT, NULL, &action);
#ifdef HAVE_SA_SIGACTION
if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) { if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
#else
if ( action.sa_handler == SIG_DFL ) {
#endif
action.sa_handler = SDL_HandleSIG; action.sa_handler = SDL_HandleSIG;
sigaction(SIGINT, &action, NULL); sigaction(SIGINT, &action, NULL);
} }
sigaction(SIGTERM, NULL, &action); sigaction(SIGTERM, NULL, &action);
#ifdef HAVE_SA_SIGACTION
if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) { if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
#else
if ( action.sa_handler == SIG_DFL ) {
#endif
action.sa_handler = SDL_HandleSIG; action.sa_handler = SDL_HandleSIG;
sigaction(SIGTERM, &action, NULL); sigaction(SIGTERM, &action, NULL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment