From c8d06ad9146d939718dec9ee01b39e4e7012ef23 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Wed, 22 Sep 2004 09:28:13 +0000 Subject: [PATCH] Make cleanup.c compile cleanly under c99. Change cleanup.c so the signal bits all compile cleanly under C99 with -DBSD_SOURCE=1. --- cleanup.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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; } -- 2.39.5