Check sa_sigaction member of struct sigaction SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Thu, 14 Jul 2011 15:40:07 +0200
branchSDL-1.2
changeset 55654225f09eb8cb
parent 5561 62269926f506
child 5568 abe7d0b3539b
Check sa_sigaction member of struct sigaction
configure.in
src/events/SDL_quit.c
     1.1 --- a/configure.in	Wed Jul 13 17:36:29 2011 -0700
     1.2 +++ b/configure.in	Thu Jul 14 15:40:07 2011 +0200
     1.3 @@ -185,6 +185,8 @@
     1.4  
     1.5      AC_CHECK_LIB(iconv, libiconv_open, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -liconv"])
     1.6      AC_CHECK_LIB(m, pow, [EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"])
     1.7 +
     1.8 +    AC_CHECK_MEMBER(struct sigaction.sa_sigaction,[AC_DEFINE(HAVE_SA_SIGACTION)], ,[#include <signal.h>])
     1.9  fi
    1.10  
    1.11  if test x$have_inttypes != xyes; then
     2.1 --- a/src/events/SDL_quit.c	Wed Jul 13 17:36:29 2011 -0700
     2.2 +++ b/src/events/SDL_quit.c	Thu Jul 14 15:40:07 2011 +0200
     2.3 @@ -48,12 +48,20 @@
     2.4  #ifdef HAVE_SIGACTION
     2.5  	struct sigaction action;
     2.6  	sigaction(SIGINT, NULL, &action);
     2.7 +#  ifdef HAVE_SA_SIGACTION
     2.8  	if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
     2.9 +#  else
    2.10 +	if ( action.sa_handler == SIG_DFL ) {
    2.11 +#  endif
    2.12  		action.sa_handler = SDL_HandleSIG;
    2.13  		sigaction(SIGINT, &action, NULL);
    2.14  	}
    2.15  	sigaction(SIGTERM, NULL, &action);
    2.16 +#  ifdef HAVE_SA_SIGACTION
    2.17  	if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
    2.18 +#  else
    2.19 +	if ( action.sa_handler == SIG_DFL ) {
    2.20 +#  endif
    2.21  		action.sa_handler = SDL_HandleSIG;
    2.22  		sigaction(SIGTERM, &action, NULL);
    2.23  	}