diff --git a/configure.in b/configure.in index 1b2a07f26..37a59233a 100644 --- a/configure.in +++ b/configure.in @@ -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_FUNCS(iconv) + + AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include ]) fi AC_CHECK_SIZEOF(void*) diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index f4ea2f84a..6c5714c15 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -139,6 +139,7 @@ #undef HAVE_SINF #undef HAVE_SQRT #undef HAVE_SIGACTION +#undef HAVE_SA_SIGACTION #undef HAVE_SETJMP #undef HAVE_NANOSLEEP #undef HAVE_SYSCONF diff --git a/src/events/SDL_quit.c b/src/events/SDL_quit.c index 99411c23b..1a3aa003f 100644 --- a/src/events/SDL_quit.c +++ b/src/events/SDL_quit.c @@ -49,12 +49,21 @@ SDL_QuitInit(void) #ifdef HAVE_SIGACTION struct sigaction action; sigaction(SIGINT, NULL, &action); +#ifdef HAVE_SA_SIGACTION 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; sigaction(SIGINT, &action, NULL); } sigaction(SIGTERM, NULL, &action); + +#ifdef HAVE_SA_SIGACTION 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; sigaction(SIGTERM, &action, NULL); }