diff options
author | Michael Adam <obnox@samba.org> | 2009-10-25 19:24:36 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-10-25 23:33:37 +0100 |
commit | 1b4d130cf5291a174f0e2af26573b890e535f5f7 (patch) | |
tree | 31c632818ce8e34f24e2f77ceff62bf2bf0f09b1 /src/child.c | |
parent | b837e65b21a6f4d9cb45bdab5cc6eff3193c663f (diff) | |
download | tinyproxy-1b4d130cf5291a174f0e2af26573b890e535f5f7.tar.gz tinyproxy-1b4d130cf5291a174f0e2af26573b890e535f5f7.zip |
child: handle SIGHUP in the child by reloading the filter file
Diffstat (limited to '')
-rw-r--r-- | src/child.c | 14 |
1 files changed, 13 insertions, 1 deletions
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; |