chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libsystemd: sync kdbus.h
[elogind.git]
/
src
/
timedate
/
timedated.c
diff --git
a/src/timedate/timedated.c
b/src/timedate/timedated.c
index 6d4388c70c1ca77b84b00dc60360d42abaa31e2e..d85ce57394468347028cdadcca9b5577246a29e7 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
@@
-788,7
+791,7
@@
static int connect_bus(Context *c, sd_event *event, sd_bus **_bus) {
return r;
}
return r;
}
- r = sd_bus_request_name(bus, "org.freedesktop.timedate1",
SD_BUS_NAME_REPLACE_EXISTING|SD_BUS_NAME_DO_NOT_QUEUE
);
+ r = sd_bus_request_name(bus, "org.freedesktop.timedate1",
0
);
if (r < 0) {
log_error("Failed to register name: %s", strerror(-r));
return r;
if (r < 0) {
log_error("Failed to register name: %s", strerror(-r));
return r;
@@
-836,6
+839,8
@@
int main(int argc, char *argv[]) {
goto finish;
}
goto finish;
}
+ sd_event_set_watchdog(event, true);
+
r = connect_bus(&context, event, &bus);
if (r < 0)
goto finish;
r = connect_bus(&context, event, &bus);
if (r < 0)
goto finish;
@@
-852,14
+857,12
@@
int main(int argc, char *argv[]) {
goto finish;
}
goto finish;
}
- r = bus_event_loop_with_idle(event, bus, "org.freedesktop.timedate1", DEFAULT_EXIT_USEC);
+ r = bus_event_loop_with_idle(event, bus, "org.freedesktop.timedate1", DEFAULT_EXIT_USEC
, NULL, NULL
);
if (r < 0) {
log_error("Failed to run event loop: %s", strerror(-r));
goto finish;
}
if (r < 0) {
log_error("Failed to run event loop: %s", strerror(-r));
goto finish;
}
- r = 0;
-
finish:
context_free(&context, bus);
finish:
context_free(&context, bus);