tree-wide: stop assigning colon prefixed timezone to $TZ
glibc (and also musl, though we do not officially support it yet) silently ignores colon prefix in $TZ. Let's always not prefix the timezone. tzset(3) states: > A nonempty value of TZ can be one of two formats, either of which can > be preceded by a colon which is ignored. Addresses https://github.com/systemd/systemd/pull/38876#discussion_r2384347594.
This commit is contained in:
@@ -1436,10 +1436,7 @@ int calendar_spec_next_usec(const CalendarSpec *spec, usec_t usec, usec_t *ret_n
|
||||
|
||||
SAVE_TIMEZONE;
|
||||
|
||||
/* tzset(3) says $TZ should be prefixed with ":" if we reference timezone files */
|
||||
const char *colon_tz = strjoina(":", spec->timezone);
|
||||
|
||||
r = RET_NERRNO(setenv("TZ", colon_tz, 1));
|
||||
r = RET_NERRNO(setenv("TZ", spec->timezone, /* overwrite = */ true));
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user