aboutsummaryrefslogtreecommitdiffstats
path: root/src/evmgr.c
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2019-02-21 14:39:59 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2019-03-22 12:21:54 +0100
commit0e2b5f5b7fa3a09abf61c8253efce7c7f2b4c444 (patch)
tree85f54ba7b0301245553e86704d28dfccaa031013 /src/evmgr.c
parentf2f086fa99e47ca8b3001831ea3548f8758e1222 (diff)
Allow to remove libmicrohttpd (HTTP server)
This allows to remove the dependency to libmicrohttpd. At the end, this will allow either to replace it with an other HTTP library or to fully remove the HTTP server. It also makes a tiny improvement of the conditionnal compilation. Change-Id: I24106659af04453b6693f2cda0939a601391202f Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/evmgr.c')
-rw-r--r--src/evmgr.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/evmgr.c b/src/evmgr.c
index d26502df..d11e5a6c 100644
--- a/src/evmgr.c
+++ b/src/evmgr.c
@@ -241,7 +241,7 @@ error:
*/
void evmgr_run(struct evmgr *evmgr)
{
- int rc;
+ int rc __attribute__((unused));
evmgr->state = EVLOOP_STATE_WAIT|EVLOOP_STATE_RUN;
rc = fdev_epoll_wait_and_dispatch(evmgr->fdev_epoll, -1);
@@ -284,14 +284,13 @@ static void on_evmgr_efd(void *closure, uint32_t event, struct fdev *fdev)
*/
int evmgr_create(struct evmgr **result)
{
- int rc;
struct evmgr *evmgr;
/* creates the evmgr on need */
evmgr = malloc(sizeof *evmgr);
if (!evmgr) {
ERROR("out of memory");
- rc = -ENOMEM;
+ errno = ENOMEM;
goto error;
}
@@ -299,7 +298,6 @@ int evmgr_create(struct evmgr **result)
evmgr->efd = eventfd(0, EFD_CLOEXEC|EFD_SEMAPHORE);
if (evmgr->efd < 0) {
ERROR("can't make eventfd for events");
- rc = -errno;
goto error1;
}
@@ -334,7 +332,7 @@ error1:
free(evmgr);
error:
*result = 0;
- return rc;
+ return errno ? -errno : -1;
}
#endif