Skip to content

Commit

Permalink
Check sa_sigaction member of struct sigaction
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Jul 14, 2011
1 parent 5cc87f9 commit 8ac7e0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions configure.in
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/events/SDL_quit.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8ac7e0f

Please sign in to comment.