From 439c464250a61224c8f52504216bd68daeb95431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Wed, 2 Feb 2022 14:33:10 +0100 Subject: [PATCH] MINOR: quic: EINTR error ignored This should fix Coverity CID 375050 in GH #1536 where EINTR errno was ignored due to wrong do...while() loop usage. --- src/quic_sock.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/quic_sock.c b/src/quic_sock.c index ddfd865e8..1d4564098 100644 --- a/src/quic_sock.c +++ b/src/quic_sock.c @@ -233,14 +233,11 @@ void quic_sock_fd_iocb(int fd) do { ret = recvfrom(fd, dgram_buf, max_sz, 0, (struct sockaddr *)&saddr, &saddrlen); - if (ret < 0) { - if (errno == EINTR) - continue; - if (errno == EAGAIN) - fd_cant_recv(fd); + if (ret < 0 && errno == EAGAIN) { + fd_cant_recv(fd); goto out; } - } while (0); + } while (ret < 0 && errno == EINTR); b_add(buf, ret); if (!quic_lstnr_dgram_dispatch(dgram_buf, ret, l, &saddr,