Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 466ff57

Browse files
J William Piggottkarelzak
authored andcommitted
hwclock: Remove TZUTC
commit d53f8ec introduced the TZUTC environment variable to facilitate use of the zoneinfo 'right' database. This was incorrect. Either the TZDIR environment variable should be used or a system-wide configuration for the 'right' database should be used. See hwclock(8) POSIX vs 'RIGHT' for more details. TZUTC was undocumented and should be safe to remove. The commit also caused a regression when using musl libc, because when TZUTC is unset getenv() returns a NULL pointer. Reported-by: Isaac Dunham <[email protected]> Signed-off-by: J William Piggott <[email protected]>
1 parent b2dcce9 commit 466ff57

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

sys-utils/hwclock.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,8 @@ mktime_tz(struct tm tm, const bool universal,
400400
*/
401401
zone = getenv("TZ"); /* remember original time zone */
402402
if (universal) {
403-
/* Set timezone to UTC as defined by the environment
404-
* variable TZUTC. TZUTC undefined gives the default UTC
405-
* zonefile which usually does not take into account leap
406-
* seconds. Define TZUTC to select your UTC zonefile which
407-
* does include leap seconds. For example, with recent GNU
408-
* libc's:
409-
* TZUTC=:/usr/share/zoneinfo/right/UTC
410-
*/
411-
setenv("TZ", getenv("TZUTC"), TRUE);
403+
/* Set timezone to UTC */
404+
setenv("TZ", "", TRUE);
412405
/*
413406
* Note: tzset() gets called implicitly by the time code,
414407
* but only the first time. When changing the environment

0 commit comments

Comments
 (0)