From 0be6c2f617732902921d42bb0705f016b2838aba Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 19 Nov 2015 23:33:55 +0100 Subject: sd-event: define a new PREPARING state We already have a state RUNNING and EXITING when we dispatch regular and exit callbacks. Let's introduce a new state called PREPARING that is active while we invoke preparation callbacks. This way we have a state each for all three kinds of event handlers. The states are currently not documented, hence let's add a new state to the end, before we start documenting this. --- src/libsystemd/sd-event/sd-event.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libsystemd') diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index e68d76708a..e8e3d7306f 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -2437,7 +2437,9 @@ _public_ int sd_event_prepare(sd_event *e) { e->iteration++; + e->state = SD_EVENT_PREPARING; r = event_prepare(e); + e->state = SD_EVENT_INITIAL; if (r < 0) return r; -- cgit v1.2.3-54-g00ecf