mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 16:59:03 +03:00
timedatectl: when no timezone is set consider UTC the default
This fixes #993, and ensures that the libc does not consider any old timezone information into account, that was set earlier.
This commit is contained in:
parent
2c04e5c7e5
commit
bdeb9e603a
@ -96,7 +96,7 @@ static void print_status_info(const StatusInfo *i) {
|
|||||||
old_tz = strdupa(tz);
|
old_tz = strdupa(tz);
|
||||||
|
|
||||||
/* Set the new $TZ */
|
/* Set the new $TZ */
|
||||||
if (i->timezone && setenv("TZ", i->timezone, true) < 0)
|
if (setenv("TZ", isempty(i->timezone) ? "UTC" : i->timezone, true) < 0)
|
||||||
log_warning_errno(errno, "Failed to set TZ environment variable, ignoring: %m");
|
log_warning_errno(errno, "Failed to set TZ environment variable, ignoring: %m");
|
||||||
else
|
else
|
||||||
tzset();
|
tzset();
|
||||||
|
Loading…
Reference in New Issue
Block a user