diff --git a/api.c b/api.c index fc102ad3..33805afe 100644 --- a/api.c +++ b/api.c @@ -126,9 +126,15 @@ static int do_query_inetd(char *buf, size_t len) static void cb(uev_t *w, void *UNUSED(arg), int UNUSED(events)) { - int sd = accept(w->fd, NULL, NULL); + int sd; struct init_request rq; + sd = accept(w->fd, NULL, NULL); + if (sd < 0) { + _pe("Failed serving API request"); + return; + } + while (1) { int result = 0; ssize_t len;