summary refs log tree commit diff stats
path: root/lib/pure
diff options
context:
space:
mode:
authorHans Raaf <hara@oderwat.de>2015-03-10 23:28:45 +0100
committerHans Raaf <hara@oderwat.de>2015-03-12 17:00:06 +0100
commit798e5c755203e93505740d5d8eac19bf8ae2acf1 (patch)
tree56f61f548bc69b283a2171a9d50c51640b9325ac /lib/pure
parent0a0126d49aecc7915ae115f267f99d9510c70bdb (diff)
downloadNim-798e5c755203e93505740d5d8eac19bf8ae2acf1.tar.gz
Adding a call to tzset() to implicitly initialize the tzname infos.
Diffstat (limited to 'lib/pure')
-rw-r--r--lib/pure/times.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index c39667611..990874981 100644
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -48,6 +48,11 @@ when defined(posix) and not defined(JS):
   proc posix_gettimeofday(tp: var Timeval, unused: pointer = nil) {.
     importc: "gettimeofday", header: "<sys/time.h>".}
 
+  # we also need tzset() to make sure that tzname is initialized
+  proc tzset() {.importc, header: "<sys/time.h>".}
+  # calling tzset() implicitly to initialize tzname data.
+  tzset()
+
 elif defined(windows):
   import winlean