Skip to contentSkip to conversation

Fix: timegm compat on Solaris

PATCH Jérémie Galarneau 1 participant 1 message Nov 13, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jérémie Galarneau

author Applied
#1 lore raw

Merged, thanks!

Jérémie

Quoted 29 lines · Michael Jeanson

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".

---
 include/babeltrace/compat/utc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/babeltrace/compat/utc.h +2 -3
index d59d856..ab080f2 100644
@@ -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) {
--

2.7.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev