aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-01 17:05:35 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-01 17:05:35 +0000
commit0ee5ff3f3942a0396b6dba336dee736a2f14dc4c (patch)
tree323f0e821a56df2a8fe79aed2128a8a241cda81c /src/libserver
parentf230a889c1781037953edef0bba63e1804366850 (diff)
downloadrspamd-0ee5ff3f3942a0396b6dba336dee736a2f14dc4c.tar.gz
rspamd-0ee5ff3f3942a0396b6dba336dee736a2f14dc4c.zip
Add post-signal handler.
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/worker_util.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index 3da7af891..99829edb0 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -67,6 +67,10 @@ rspamd_worker_usr2_handler (gint fd, short what, void *arg)
msg_info ("worker's shutdown is pending in %d sec", SOFT_SHUTDOWN_TIME);
event_base_loopexit (sigh->base, &tv);
}
+
+ if (sigh->post_handler) {
+ sigh->post_handler (sigh->handler_data);
+ }
}
/*
@@ -79,6 +83,10 @@ rspamd_worker_usr1_handler (gint fd, short what, void *arg)
(struct rspamd_worker_signal_handler *)arg;
reopen_log (sigh->worker->srv->logger);
+
+ if (sigh->post_handler) {
+ sigh->post_handler (sigh->handler_data);
+ }
}
static void
@@ -98,6 +106,10 @@ rspamd_worker_term_handler (gint fd, short what, void *arg)
ProfilerStop ();
#endif
}
+
+ if (sigh->post_handler) {
+ sigh->post_handler (sigh->handler_data);
+ }
}
static void
@@ -118,7 +130,7 @@ rspamd_worker_set_signal_handler (int signo, struct rspamd_worker *worker,
{
struct rspamd_worker_signal_handler *sigh;
- sigh = g_malloc (sizeof (*sigh));
+ sigh = g_malloc0 (sizeof (*sigh));
sigh->signo = signo;
sigh->worker = worker;
sigh->base = base;