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);