chiark / gitweb /
timedated: make sure GetAll() succeeds in systems lacking /dev/rtc (such as containers)
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Dec 2013 02:00:57 +0000 (03:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 Dec 2013 02:06:21 +0000 (03:06 +0100)
src/libsystemd-bus/bus-util.c
src/timedate/timedated.c

index 0a3f6b85f5422796ba4a5f7747feefb742f6c8d3..9a42b051aaf4774406b1e9e9ee97b55a52ef8691 100644 (file)
@@ -931,7 +931,8 @@ int bus_map_all_properties(sd_bus *bus,
         assert(path);
         assert(map);
 
-        r = sd_bus_call_method( bus,
+        r = sd_bus_call_method(
+                        bus,
                         destination,
                         path,
                         "org.freedesktop.DBus.Properties",
index af2b0785cf6bafa026c3d55530ad74591fee57ca..e3421c24a9ac16a53782f6220771b7e9fdc1a386 100644 (file)
@@ -470,6 +470,9 @@ static int property_get_rtc_time(
         if (r == -EBUSY) {
                 log_warning("/dev/rtc is busy, is somebody keeping it open continously? That's not a good idea... Returning a bogus RTC timestamp.");
                 t = 0;
+        } else if (r == -ENOENT) {
+                log_debug("Not /dev/rtc found.");
+                t = 0; /* no RTC found */
         } else if (r < 0)
                 return sd_bus_error_set_errnof(error, r, "Failed to read RTC: %s", strerror(-r));
         else