Fix: timegm compat on Solaris
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 13 Nov 2017 20:06:29 +0000 (15:06 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Jan 2018 19:15:28 +0000 (14:15 -0500)
On Solaris 11 setting TZ to an empty string before calling mktime will
in some circumstances do the conversion in localtime instead of UTC as
expected.

Replace the empty string by "UTC".

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/babeltrace/compat/utc.h

index d59d8564f47b6f37e9cd4fea5ccd8e83cc0ebfef..ab080f2e3354056832012991876506a1ac67ff4a 100644 (file)
@@ -67,8 +67,8 @@ time_t babeltrace_timegm(struct tm *tm)
                }
        }
 
-       /* Temporarily setting TZ to 1 for UTC */
-       setenv("TZ", "", 1);
+       /* Temporarily setting TZ to UTC */
+       setenv("TZ", "UTC", 1);
        tzset();
        ret = mktime(tm);
        if (tz) {
This page took 0.032716 seconds and 4 git commands to generate.