tree-wide: fix how we set $TZ

According to tzset(3) we need to prefix timezone names with ":". Let's
do so hence, to avoid any ambiguities and follow documented behaviour.
This commit is contained in:
Lennart Poettering
2019-11-13 12:30:22 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent d5fc5b2f8d
commit 437f48a471
6 changed files with 23 additions and 11 deletions
+6 -1
View File
@@ -1352,7 +1352,12 @@ int calendar_spec_next_usec(const CalendarSpec *spec, usec_t usec, usec_t *ret_n
return r;
}
if (r == 0) {
if (setenv("TZ", spec->timezone, 1) != 0) {
char *colon_tz;
/* tzset(3) says $TZ should be prefixed with ":" if we reference timezone files */
colon_tz = strjoina(":", spec->timezone);
if (setenv("TZ", colon_tz, 1) != 0) {
shared->return_value = negative_errno();
_exit(EXIT_FAILURE);
}