summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-10-11 04:23:35 +0200
committerLennart Poettering <lennart@poettering.net>2011-10-11 04:23:35 +0200
commita724d2ed799a8985193ba70c5c3e76f621815e10 (patch)
treeb597388ccf24a0a9f53d45ead892838e569d5f5c /src
parent8266f984df0b069a345bf959628bac70877ce5e1 (diff)
timedate: fall back to /etc/sysconfig/clock on Fedora, for compatibility with legacy
Diffstat (limited to 'src')
-rw-r--r--src/timedated.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/timedated.c b/src/timedated.c
index f6fe2d83b6..16f54b59d2 100644
--- a/src/timedated.c
+++ b/src/timedated.c
@@ -170,8 +170,24 @@ static int read_data(void) {
free_data();
r = read_one_line_file("/etc/timezone", &zone);
- if (r < 0 && r != -ENOENT)
- return r;
+ if (r < 0) {
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/timezone: %s", strerror(-r));
+
+#ifdef TARGET_FEDORA
+ r = parse_env_file("/etc/sysconfig/clock", NEWLINE,
+ "ZONE", &zone,
+ NULL);
+
+ if (r < 0 && r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/clock: %s", strerror(-r));
+#endif
+ }
+
+ if (isempty(zone)) {
+ free(zone);
+ zone = NULL;
+ }
verify_timezone();