Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add gitreview file for Kooky Koi branch
[src/app-framework-binder.git]
/
src
/
evmgr.c
diff --git
a/src/evmgr.c
b/src/evmgr.c
index
2dc35e4
..
623bdf7
100644
(file)
--- a/
src/evmgr.c
+++ b/
src/evmgr.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 201
6-2019
"IoT.bzh"
+ * Copyright (C) 201
5-2020
"IoT.bzh"
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@
-47,6
+47,14
@@
struct evmgr
#define EVLOOP_STATE_WAIT 1U
#define EVLOOP_STATE_RUN 2U
#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.
*/
/**
* Run the event loop is set.
*/
@@
-185,13
+193,14
@@
int evmgr_create(struct evmgr **result)
/* creates the eventfd for waking up polls */
evmgr->efd = eventfd(0, EFD_CLOEXEC|EFD_SEMAPHORE);
if (evmgr->efd < 0) {
/* 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;
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) {
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;
}
ERROR("can't make new event loop");
goto error2;
}