From: Michael Jeanson Date: Mon, 13 Nov 2017 20:06:29 +0000 (-0500) Subject: Fix: timegm compat on Solaris X-Git-Tag: v1.4.4~14 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=e08b9e07b43b305ee9f31690b5c27e5ae24f0078;ds=sidebyside Fix: timegm compat on Solaris 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 Signed-off-by: Jérémie Galarneau --- diff --git a/include/babeltrace/compat/utc.h b/include/babeltrace/compat/utc.h index d59d8564..ab080f2e 100644 --- a/include/babeltrace/compat/utc.h +++ b/include/babeltrace/compat/utc.h @@ -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) {