systemd/0034-timedatectl-when-no-ti...

29 lines
1.0 KiB
Diff

From f489997fcb7e2d93ba46279f5a628006bbac88e9 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 20 Aug 2015 12:16:13 +0200
Subject: [PATCH 34/47] 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(-)
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 8ec6adb..1c3f03c 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();
--
2.5.0