src/events/SDL_quit.c
branchSDL-1.2
changeset 5565 4225f09eb8cb
parent 5500 27348c0ae529
child 6137 4720145f848b
equal deleted inserted replaced
5561:62269926f506 5565:4225f09eb8cb
    46 int SDL_QuitInit(void)
    46 int SDL_QuitInit(void)
    47 {
    47 {
    48 #ifdef HAVE_SIGACTION
    48 #ifdef HAVE_SIGACTION
    49 	struct sigaction action;
    49 	struct sigaction action;
    50 	sigaction(SIGINT, NULL, &action);
    50 	sigaction(SIGINT, NULL, &action);
       
    51 #  ifdef HAVE_SA_SIGACTION
    51 	if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
    52 	if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
       
    53 #  else
       
    54 	if ( action.sa_handler == SIG_DFL ) {
       
    55 #  endif
    52 		action.sa_handler = SDL_HandleSIG;
    56 		action.sa_handler = SDL_HandleSIG;
    53 		sigaction(SIGINT, &action, NULL);
    57 		sigaction(SIGINT, &action, NULL);
    54 	}
    58 	}
    55 	sigaction(SIGTERM, NULL, &action);
    59 	sigaction(SIGTERM, NULL, &action);
       
    60 #  ifdef HAVE_SA_SIGACTION
    56 	if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
    61 	if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL ) {
       
    62 #  else
       
    63 	if ( action.sa_handler == SIG_DFL ) {
       
    64 #  endif
    57 		action.sa_handler = SDL_HandleSIG;
    65 		action.sa_handler = SDL_HandleSIG;
    58 		sigaction(SIGTERM, &action, NULL);
    66 		sigaction(SIGTERM, &action, NULL);
    59 	}
    67 	}
    60 #elif HAVE_SIGNAL_H
    68 #elif HAVE_SIGNAL_H
    61 	void (*ohandler)(int);
    69 	void (*ohandler)(int);