summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/proto-irc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index b19d9afa..29102afc 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -1337,8 +1337,16 @@ get_timezone(void)
 
 	time (&t);
 
+	/* gmtime() and localtime() are thread-safe on windows.
+	 * on other systems we should use {gmtime,localtime}_r().
+	 */
+#if WIN32
+	tm_utc = *gmtime (&t);
+	tm_local = *localtime (&t);
+#else
 	gmtime_r (&t, &tm_utc);
 	localtime_r (&t, &tm_local);
+#endif
 
 	time_utc = mktime (&tm_utc);
 	time_local = mktime (&tm_local);