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(-) 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