Check sa_sigaction member of struct sigaction

--HG--
branch : SDL-1.2
This commit is contained in:
Patrice Mandin
2011-07-14 15:40:07 +02:00
parent d4bb6faea5
commit b92c1e4101
2 changed files with 10 additions and 0 deletions

View File

@@ -185,6 +185,8 @@ if test x$enable_libc = xyes; then
AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
fi
if test x$have_inttypes != xyes; then

View File

@@ -48,12 +48,20 @@ int 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);
}