Handle event loop watcher failure modes

When alibuEv event watcher callback has `UEV_ERROR` in the events mask
we must handle the error.  Unfortunately, in most cases there is not
much we can do but ignore it or log the error.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2017-11-12 11:18:12 +01:00
1 parent 168da2a5c6
commit 6826d7ee3f
4 files changed
+52 -1

No files matched your search

+5
View File
@@ -173,6 +173,11 @@ static void cb(uev_t *w, void *arg, int events)
int sd, lvl;
struct init_request rq;
if (UEV_ERROR == events) {
_e("Unrecoverable error on API socket");
return;
}
sd = accept(w->fd, NULL, NULL);
if (sd < 0) {
_pe("Failed serving API request");