summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-08-26 00:22:06 +0200
committerTom Gundersen <teg@jklm.no>2014-08-26 00:22:06 +0200
commit6d148a842ebb04a9a9bc2853e167a9d8eddf8cd8 (patch)
tree631f129867088f2d8fe1603be6e83e8aac5e648a /src
parentc45a5a74465a39280b855f9d720b2ab4779a47fa (diff)
sd-event: sd_event_prepare - stay in PREPARED if sd_event_wait() indicates that no sources are pending
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-event/sd-event.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index a71962c24c..32777e386b 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -2256,7 +2256,11 @@ _public_ int sd_event_prepare(sd_event *e) {
pending:
e->state = SD_EVENT_PREPARED;
- return sd_event_wait(e, 0);
+ r = sd_event_wait(e, 0);
+ if (r == 0)
+ e->state = SD_EVENT_PREPARED;
+
+ return r;
}
_public_ int sd_event_wait(sd_event *e, uint64_t timeout) {