X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/a8ef501f8a174ef7eb96baa1803e1ad58e703831..8d14d66b84cc370cefe54b33de1b95bb49c90bf6:/cleanup.c?ds=sidebyside 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; }