summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd')
-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) {