From 2914fe7b5c169744fb3756d504ee22abbff46716 Mon Sep 17 00:00:00 2001 From: yrutschle Date: Tue, 26 Aug 2025 22:23:30 +0200 Subject: [PATCH] fix embarassingly wrong error check --- tcp-listener.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcp-listener.c b/tcp-listener.c index 9f2a16d..1bd33ec 100644 --- a/tcp-listener.c +++ b/tcp-listener.c @@ -165,7 +165,7 @@ struct connection* accept_new_connection(struct listen_endpoint* endpoint, struc print_message(msg_fd, "accepting from %d\n", listen_socket); in_socket = accept(listen_socket, 0, 0); - if ((res == -1) && (errno == EAGAIN)) return NULL; /* Do not log if we're just retring next iteration */ + if ((in_socket == -1) && (errno == EAGAIN)) return NULL; /* Do not log if we're just retring next iteration */ CHECK_RES_RETURN(in_socket, "accept", NULL); res = set_nonblock(in_socket);