From bdeb9e603ab3f43d0d39f27ce6272f1114a4ee96 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 20 Aug 2015 12:16:13 +0200 Subject: 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. --- src/timedate/timedatectl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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(); -- cgit v1.2.3-54-g00ecf