projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2c04e5c
)
timedatectl: when no timezone is set consider UTC the default
author
Lennart Poettering
<lennart@poettering.net>
Thu, 20 Aug 2015 10:16:13 +0000
(12:16 +0200)
committer
Lennart 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
patch
|
blob
|
history
diff --git
a/src/timedate/timedatectl.c
b/src/timedate/timedatectl.c
index
8ec6adb
..
1c3f03c
100644
(file)
--- 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();