21 #include "../SDL_internal.h" 55 struct sigaction action;
56 sigaction(SIGINT,
NULL, &action);
57 #ifdef HAVE_SA_SIGACTION 58 if ( action.sa_handler == SIG_DFL && (
void (*)(
int))action.sa_sigaction == SIG_DFL ) {
60 if ( action.sa_handler == SIG_DFL ) {
63 sigaction(SIGINT, &action,
NULL);
65 sigaction(SIGTERM,
NULL, &action);
67 #ifdef HAVE_SA_SIGACTION 68 if ( action.sa_handler == SIG_DFL && (
void (*)(
int))action.sa_sigaction == SIG_DFL ) {
70 if ( action.sa_handler == SIG_DFL ) {
73 sigaction(SIGTERM, &action,
NULL);
76 void (*ohandler) (int);
80 if (ohandler != SIG_DFL)
81 signal(SIGINT, ohandler);
83 if (ohandler != SIG_DFL)
84 signal(SIGTERM, ohandler);
103 #ifdef HAVE_SIGACTION 104 struct sigaction action;
105 sigaction(SIGINT,
NULL, &action);
107 action.sa_handler = SIG_DFL;
108 sigaction(SIGINT, &action,
NULL);
110 sigaction(SIGTERM,
NULL, &action);
112 action.sa_handler = SIG_DFL;
113 sigaction(SIGTERM, &action,
NULL);
116 void (*ohandler) (int);
118 ohandler = signal(SIGINT, SIG_DFL);
120 signal(SIGINT, ohandler);
121 ohandler = signal(SIGTERM, SIG_DFL);
123 signal(SIGTERM, ohandler);
static void SDL_HandleSIG(int sig)
static SDL_bool disable_signals
#define SDL_GetHintBoolean
static SDL_bool send_quit_pending
void SDL_SendPendingQuit(void)
static void SDL_QuitQuit_Internal(void)
#define SDL_assert(condition)
#define SDL_HINT_NO_SIGNAL_HANDLERS
Tell SDL not to catch the SIGINT or SIGTERM signals.
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
int SDL_SendAppEvent(SDL_EventType eventType)
static int SDL_QuitInit_Internal(void)