From 3142387c19602c242ca0bb03e0a1118048e76f74 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 11 Sep 2007 07:34:04 +0000 Subject: applied patch by varmojfekoj to change signal handling to the new sigaction API set (replacing the depreciated signal() calls and its friends. --- rfc3195d.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'rfc3195d.c') diff --git a/rfc3195d.c b/rfc3195d.c index ee7891be..2a06d699 100644 --- a/rfc3195d.c +++ b/rfc3195d.c @@ -194,6 +194,7 @@ int main(int argc, char* argv[]) { srRetVal iRet; int ch; + struct sigaction_t sigAct; while ((ch = getopt(argc, argv, "di:np:r:v")) != EOF) switch((char)ch) { @@ -231,10 +232,17 @@ int main(int argc, char* argv[]) if ((argc -= optind)) usage(); + memset(&sigAct, 0, sizeof(sigAct)); + sigemptyset(&sigAct.sa_mask); + sigAct.sa_handler = doShutdown; + sigaction(SIGUSR1, &sigAct, NULL); + sigaction(SIGTERM, &sigAct, NULL); + if(!Debug) - signal(SIGINT, SIG_IGN); - signal(SIGUSR1, doShutdown); - signal(SIGTERM, doShutdown); + { + sigAct.sa_handler = SIG_IGN; + sigaction(SIGINT, &sigAct, NULL); + } if((pAPI = srAPIInitLib()) == NULL) { -- cgit