summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-12-23 00:18:31 +0100
committerMichael Adam <obnox@samba.org>2009-12-23 00:31:55 +0100
commitfb2e65f40bc549f42a61bbcbe717438bad653fc7 (patch)
tree5ac8260fce83d2bc87f07aeb5673bb6c56caf33c /src
parentc4b9454807efa2e1717010f87c2c226ea785f1e5 (diff)
downloadtinyproxy-fb2e65f40bc549f42a61bbcbe717438bad653fc7.tar.gz
tinyproxy-fb2e65f40bc549f42a61bbcbe717438bad653fc7.zip
enhance reload_config to correctly re-initialize the logging subsystem.
This includes reopening the log file (in append mode). Also switching from syslog to logfile and visa versa are included when called from the SIGHUP handler. Michael
Diffstat (limited to 'src')
-rw-r--r--src/main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index e35ef35..ca9487b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -325,14 +325,23 @@ static void initialize_config_defaults (struct config_s *conf)
/**
* convenience wrapper around reload_config_file
+ * that also re-initializes logging.
*/
int reload_config (void)
{
int ret;
+ shutdown_logging ();
+
ret = reload_config_file (config_defaults.config_file, &config,
&config_defaults);
+ if (ret != 0) {
+ goto done;
+ }
+
+ ret = setup_logging ();
+done:
return ret;
}