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.
diff --git a/src/quic_sock.c b/src/quic_sock.c
index ddfd865..1d45640 100644
--- a/src/quic_sock.c
+++ b/src/quic_sock.c
@@ -233,14 +233,11 @@
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,