From 1b4d130cf5291a174f0e2af26573b890e535f5f7 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sun, 25 Oct 2009 19:24:36 +0100 Subject: child: handle SIGHUP in the child by reloading the filter file --- src/child.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/child.c b/src/child.c index a55f855..0a79d7e 100644 --- a/src/child.c +++ b/src/child.c @@ -160,6 +160,18 @@ short int child_configure (child_config_t type, unsigned int val) return 0; } +/** + * child signal handler for sighup + */ +static void child_sighup_handler (int sig) +{ + if (sig == SIGHUP) { +#ifdef FILTER_ENABLE + filter_reload (); +#endif /* FILTER_ENABLE */ + } +} + /* * This is the main (per child) loop. */ @@ -272,7 +284,7 @@ static pid_t child_make (struct child_s *ptr) */ set_signal_handler (SIGCHLD, SIG_DFL); set_signal_handler (SIGTERM, SIG_DFL); - set_signal_handler (SIGHUP, SIG_DFL); + set_signal_handler (SIGHUP, child_sighup_handler); child_main (ptr); /* never returns */ return -1; -- cgit v1.2.3