chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timedated: make sure GetAll() succeeds in systems lacking /dev/rtc (such as containers)
[elogind.git]
/
src
/
timedate
/
timedated.c
diff --git
a/src/timedate/timedated.c
b/src/timedate/timedated.c
index af2b0785cf6bafa026c3d55530ad74591fee57ca..e3421c24a9ac16a53782f6220771b7e9fdc1a386 100644
(file)
--- a/
src/timedate/timedated.c
+++ b/
src/timedate/timedated.c
@@
-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;
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
} else if (r < 0)
return sd_bus_error_set_errnof(error, r, "Failed to read RTC: %s", strerror(-r));
else