mirror of
https://github.com/troglobit/finit.git
synced 2026-10-07 16:14:21 +07:00
Fix Coverty CID #96210: Argument cannot be negative.
We must check the return value from `accept()`, it may fail. Also, we should probably retry the syscall in some cases ... Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user