From c329ad53b1ac3176d062bc972aabba020f8e2986 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 15 Jan 2026 19:18:05 -0500 Subject: [PATCH] libroot/musl: Check gmtoff before returning timezone names. And add a fallback for GMT. Improves the situation in #18471. --- src/system/libroot/posix/musl/time/time_impl_haiku.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/system/libroot/posix/musl/time/time_impl_haiku.h b/src/system/libroot/posix/musl/time/time_impl_haiku.h index b9b4c03c36..7b9cb1a14d 100644 --- a/src/system/libroot/posix/musl/time/time_impl_haiku.h +++ b/src/system/libroot/posix/musl/time/time_impl_haiku.h @@ -4,8 +4,12 @@ __tm_to_tzname(const struct tm *tm) const void *p = tm->tm_zone; if (p) return p; - if (tm->tm_isdst >= 0) - return tzname[tm->tm_isdst != 0]; + if (tm->tm_gmtoff == timezone) + return tzname[0]; + if (tm->tm_gmtoff == daylight) + return tzname[1]; + if (tm->tm_gmtoff == 0) + return "GMT"; return ""; }