aboutsummaryrefslogtreecommitdiff
path: root/dpid
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2010-02-16 11:54:18 -0300
committerJorge Arellano Cid <jcid@dillo.org>2010-02-16 11:54:18 -0300
commitd9f18c3af927a5c69fd94fe5640eaac5c8e2574e (patch)
tree9cdde824b3b8b02002097dd53a4025023afdd0d0 /dpid
parentc41381ed695b3553b0454adcffca0d6a0e5520e9 (diff)
parentceb4a77cb81853fb7e7ca6f3c10f8e625f585496 (diff)
merge
Diffstat (limited to 'dpid')
-rw-r--r--dpid/dpid.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/dpid/dpid.c b/dpid/dpid.c
index b66928ad..246894ae 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);
}
@@ -117,6 +116,7 @@ void est_dpi_terminator()
sigset_t block;
sigemptyset(&block);
+ sigaddset(&block, SIGHUP);
sigaddset(&block, SIGINT);
sigaddset(&block, SIGQUIT);
sigaddset(&block, SIGTERM);
@@ -125,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);