1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 11:55:23 +03:00

Merge pull request #995 from poettering/timedate-utc

timedatectl: when no timezone is set consider UTC the default
This commit is contained in:
Daniel Mack 2015-08-21 06:20:45 +02:00
commit 9dba039e1c

View File

@ -96,7 +96,7 @@ static void print_status_info(const StatusInfo *i) {
old_tz = strdupa(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");
else
tzset();