diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-08-20 12:16:13 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-08-20 12:18:26 +0200 |
commit | bdeb9e603ab3f43d0d39f27ce6272f1114a4ee96 (patch) | |
tree | bbbc68d93bf1e437c88872e9452f84b91027efa0 /src/timedate | |
parent | Merge pull request #990 from owtaylor/issue-989 (diff) | |
download | systemd-bdeb9e603ab3f43d0d39f27ce6272f1114a4ee96.tar.xz systemd-bdeb9e603ab3f43d0d39f27ce6272f1114a4ee96.zip |
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.
Diffstat (limited to 'src/timedate')
-rw-r--r-- | src/timedate/timedatectl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 8ec6adb493..1c3f03c803 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -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(); |