fix(libc): leave tzname[1] as three spaces for a zone without daylight saving time #8546
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8546"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Retr0G28 on 2026-10-20T16:07:26Z.
What
tzname[1]for a zone without daylight saving time was empty on Windows and a copy oftzname[0]on Linux. FreeBSD 11 initializestznametoWILDABBR(three spaces) andsettznameincontrib/tzcode/stdtime/localtime.cresets both entries to it before filling them from the zone's types, so a zone with no daylight saving type, such asUTC-5orEST5, keeps three spaces intzname[1].tznameis now filled through one helper:tzname[0]is the host's standard name, andtzname[1]is the host's daylight name when the host zone has daylight saving time (_daylighton Windows,daylighton Linux) and three spaces otherwise.tm_zoneand%Zare unchanged, as a broken-down time withtm_isdst0 never readstzname[1]. The sentence about this in the tzname entry ofdocs/dev/debt/libc.mdis removed.guest_time_conversionnow checks thattzname[1]is three spaces aftertzsetand after an implicitTZchange forUTC-5andEST5;EST5EDTkeepsESTandEDT.Tested
Windows 11, WinLibs MinGW-w64 GCC 15.2.0 r7, CMake + Ninja, Release,
-DBUILD_TESTING=ON, rebased onmain47fa6eecf.guest_time_conversionfails onmain'sTime.cppwith "Implicit guest TZ update did not refresh tzname" (exit 0xc0000409 from the failedRequire); with this PR it passes.-R "time|tz|strftime|mktime|libc_static|libc_threads|system_service" -E "^agc_": 41 of 41 pass after the rebase.python tools/check_conventions.py --base origin/mainpasses.daylightthere, which glibc sets from the zone's current rules, while FreeBSD'ssettznametakestzname[1]from any daylight type in the zone file, so a zone that only had daylight saving time in the past may still differ there.Overlap:
timezoneanddaylight) merged first; this PR is rebased onto it and keeps itstimezoneanddaylightcode, changing only the twotznameassignments intzset_nid_postfix.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)