From: Lennart Poettering Date: Thu, 20 Aug 2015 10:16:13 +0000 (+0200) Subject: timedatectl: when no timezone is set consider UTC the default X-Git-Tag: v225~44^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bdeb9e603ab3f43d0d39f27ce6272f1114a4ee96;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 8ec6adb4937..1c3f03c803b 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();