Skip to content
Permalink
Browse files

Check sa_sigaction member of struct sigaction

  • Loading branch information
pmandin committed Jul 14, 2011
1 parent 5cc87f9 commit 8ac7e0f418044d2079e7cf11fba8391b75640e98
Showing with 10 additions and 0 deletions.
  1. +2 −0 configure.in
  2. +8 −0 src/events/SDL_quit.c
@@ -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
@@ -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);
}

0 comments on commit 8ac7e0f

Please sign in to comment.