summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-05 13:43:30 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-05 13:50:35 +0200
commiteec6022cf039e62233139000b9e95db943959e48 (patch)
treead31507851ea3fb4e336c9c8489d14a38acb52a5 /src
parent945933e331794b695c85c29369266daa30a50947 (diff)
sd-event: restore correct timeout behaviour
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-event/sd-event.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index c48fa37e89..53f1904d3d 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -2180,6 +2180,7 @@ _public_ int sd_event_run(sd_event *e, uint64_t timeout) {
unsigned ev_queue_max;
sd_event_source *p;
int r, i, m;
+ bool timedout;
assert_return(e, -EINVAL);
assert_return(!event_pid_changed(e), -ECHILD);
@@ -2226,6 +2227,8 @@ _public_ int sd_event_run(sd_event *e, uint64_t timeout) {
goto finish;
}
+ timedout = m == 0;
+
dual_timestamp_get(&e->timestamp);
e->timestamp_boottime = now(CLOCK_BOOTTIME);
@@ -2278,7 +2281,7 @@ _public_ int sd_event_run(sd_event *e, uint64_t timeout) {
p = event_next_pending(e);
if (!p) {
- r = 1;
+ r = !timedout;
goto finish;
}