#define EVLOOP_STATE_WAIT 1U
#define EVLOOP_STATE_RUN 2U
+/**
+ * prepare the evmgr to run
+ */
+void evmgr_prepare_run(struct evmgr *evmgr)
+{
+ evmgr->state = EVLOOP_STATE_WAIT|EVLOOP_STATE_RUN;
+}
+
/**
* Run the event loop is set.
*/
/* creates the eventfd for waking up polls */
evmgr->efd = eventfd(0, EFD_CLOEXEC|EFD_SEMAPHORE);
if (evmgr->efd < 0) {
- ERROR("can't make eventfd for events");
rc = -errno;
+ ERROR("can't make eventfd for events");
goto error1;
}
/* create the systemd event loop */
evmgr->sdev = systemd_get_event_loop();
if (!evmgr->sdev) {
+ rc = -errno;
ERROR("can't make new event loop");
goto error2;
}