diff options
Diffstat (limited to '')
-rw-r--r-- | src/signal.h | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/signal.h b/src/signal.h index 22305a9..3509a92 100644 --- a/src/signal.h +++ b/src/signal.h @@ -8,28 +8,10 @@ #ifndef __SIGNAL_H__ #define __SIGNAL_H__ -#include "compiler.h" - #include <signal.h> -#include <string.h> extern volatile sig_atomic_t global_stop_flag; - -static void signal_handler(UNUSED int signum) -{ - global_stop_flag = 1; -} - -static __attribute__((constructor)) void signal_handler_install() -{ - struct sigaction sa; - memset(&sa, 0, sizeof(sa)); - sa.sa_handler = signal_handler; - - sigaction(SIGINT, &sa, NULL); - sigaction(SIGQUIT, &sa, NULL); - sigaction(SIGTERM, &sa, NULL); -} +int signal_install_global_handler(); int signal_set(const sigset_t *new, sigset_t *old); |