chiark / gitweb /
sd-event: sd_event_prepare - stay in PREPARED if sd_event_wait() indicates that no...
authorTom Gundersen <teg@jklm.no>
Mon, 25 Aug 2014 22:22:06 +0000 (00:22 +0200)
committerTom Gundersen <teg@jklm.no>
Mon, 25 Aug 2014 22:22:06 +0000 (00:22 +0200)
src/libsystemd/sd-event/sd-event.c

index a71962c..32777e3 100644 (file)
@@ -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) {