[dovecot-cvs] dovecot/src/master main.c,1.62,1.63

cras at dovecot.org cras at dovecot.org
Sun Jul 24 00:33:54 EEST 2005


Update of /var/lib/cvs/dovecot/src/master
In directory talvi:/tmp/cvs-serv21905

Modified Files:
	main.c 
Log Message:
Preserve TZ environment to child processes so timezones aren't lost with
AIX.



Index: main.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/main.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- main.c	5 Mar 2005 20:02:07 -0000	1.62
+++ main.c	23 Jul 2005 21:33:50 -0000	1.63
@@ -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();



More information about the dovecot-cvs mailing list