]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timedatectl: when no timezone is set consider UTC the default 995/head
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Aug 2015 10:16:13 +0000 (12:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 20 Aug 2015 10:18:26 +0000 (12:18 +0200)
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

index 8ec6adb4937c2481e6f3d677c7fae9314ae5ca1f..1c3f03c803b3c19106d3e9552c5a8ed3d72b5af9 100644 (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();