From 201b0be0c0611e27c4fc4954d6f738a0150ee70f Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 9 Feb 2010 21:53:56 +0100 Subject: suppress unused parameter warning This solution was pointed out by corvid and Jorge. --- dpid/dpid.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'dpid') diff --git a/dpid/dpid.c b/dpid/dpid.c index b0ca8420..2337d5d6 100644 --- a/dpid/dpid.c +++ b/dpid/dpid.c @@ -100,11 +100,10 @@ void free_services_list(Dlist *s_list) } /*! Signal handler for SIGINT, SIGQUIT, and SIGTERM. Calls cleanup - * \todo what is the most portable way to ignore the signo argument of - * without generating a warning? Is "int signo __unused" gcc specific? */ -static void terminator() +static void terminator(int sig) { + (void) sig; /* suppress unused parameter warning */ cleanup(); _exit(0); } -- cgit v1.2.3 From 10c1a8017a92f73c0150b177c82f9b772fcfeaf1 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Wed, 10 Feb 2010 01:22:33 +0100 Subject: call dpid cleanup handler on SIGHUP Depending on the system dpid can get a SIGHUP on shutdown before it will receive SIGTERM / SIGKILL from init. Make sure we also cleanup in this case so that ~/.dillo/dpid_comm_keys is removed on reboot. --- dpid/dpid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'dpid') diff --git a/dpid/dpid.c b/dpid/dpid.c index 2337d5d6..fd94d380 100644 --- a/dpid/dpid.c +++ b/dpid/dpid.c @@ -116,6 +116,7 @@ void est_dpi_terminator() sigset_t block; sigemptyset(&block); + sigaddset(&block, SIGHUP); sigaddset(&block, SIGINT); sigaddset(&block, SIGQUIT); sigaddset(&block, SIGTERM); @@ -124,7 +125,8 @@ void est_dpi_terminator() act.sa_mask = block; act.sa_flags = 0; - if (sigaction(SIGINT, &act, NULL) || + if (sigaction(SIGHUP, &act, NULL) || + sigaction(SIGINT, &act, NULL) || sigaction(SIGQUIT, &act, NULL) || sigaction(SIGTERM, &act, NULL)) { ERRMSG("est_dpi_terminator", "sigaction", errno); -- cgit v1.2.3