diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-02-10 01:22:33 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-02-10 01:22:33 +0100 |
commit | 10c1a8017a92f73c0150b177c82f9b772fcfeaf1 (patch) | |
tree | 74f5311999a46781ccc70bb68c3f566294efa954 /dpid | |
parent | 201b0be0c0611e27c4fc4954d6f738a0150ee70f (diff) |
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.
Diffstat (limited to 'dpid')
-rw-r--r-- | dpid/dpid.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |