summaryrefslogtreecommitdiff
path: root/src/timedate
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-20 12:16:13 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-20 12:18:26 +0200
commitbdeb9e603ab3f43d0d39f27ce6272f1114a4ee96 (patch)
treebbbc68d93bf1e437c88872e9452f84b91027efa0 /src/timedate
parent2c04e5c7e530484df1ce9e3d4be609cb1670a99a (diff)
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.c2
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();