changeset 3516:71b0ccba8cf3 HEAD

Preserve TZ environment to child processes so timezones aren't lost with AIX.
author Timo Sirainen <tss@iki.fi>
date Sun, 24 Jul 2005 00:33:50 +0300
parents 1c9f3264f2fc
children 46bfbbcc3c54
files src/master/main.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/main.c	Sat Jul 23 13:13:54 2005 +0300
+++ b/src/master/main.c	Sun Jul 24 00:33:50 2005 +0300
@@ -36,6 +36,7 @@
 static struct timeout *to;
 static unsigned int settings_reload_hup_count = 0;
 static unsigned int log_reopen_usr1_count = 0;
+static const char *env_tz;
 
 struct ioloop *ioloop;
 struct hash_table *pids;
@@ -67,6 +68,8 @@
 
 	/* we'll log through master process */
 	env_put("LOG_TO_MASTER=1");
+	if (env_tz != NULL)
+		env_put(t_strconcat("TZ=", env_tz, NULL));
 
 #ifdef DEBUG
 	if (gdb) env_put("GDB=1");
@@ -626,7 +629,11 @@
 	if (exec_protocol != NULL)
 		mail_process_exec(exec_protocol, exec_section);
 
-	/* we don't need any environment anymore */
+	/* save TZ environment for child processes. AIX depends on it to get
+	   the timezone correctly. */
+	env_tz = getenv("TZ");
+
+	/* we don't need any other environment anymore */
 	env_clean();
 
 	open_fds();