X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/a8ef501f8a174ef7eb96baa1803e1ad58e703831..e1385087ec060568a966a5305a9d88c24a2a0a55:/cleanup.c diff --git a/cleanup.c b/cleanup.c index 3a33e60..ecb3322 100644 --- a/cleanup.c +++ b/cleanup.c @@ -65,17 +65,13 @@ void sig_cleanup(int signal) */ void catchsignals(void) { - struct sigaction alarmh; - logthing(LOGTHING_INFO, "Catching signals"); - memset(&alarmh, 0, sizeof(alarmh)); - alarmh.sa_handler = sig_cleanup; - sigaction(SIGALRM, &alarmh, NULL); - sigaction(SIGPIPE, &alarmh, NULL); - sigaction(SIGTERM, &alarmh, NULL); - sigaction(SIGINT, &alarmh, NULL); - sigaction(SIGHUP, &alarmh, NULL); + signal(SIGALRM, &sig_cleanup); + signal(SIGPIPE, &sig_cleanup); + signal(SIGTERM, &sig_cleanup); + signal(SIGINT, &sig_cleanup); + signal(SIGHUP, &sig_cleanup); return; }