From fd0974cf3f4b1548d8ea261b6d76c14b8c94e6ab Mon Sep 17 00:00:00 2001
From: Willy Tarreau <w@1wt.eu>
Date: Fri, 25 Nov 2022 17:04:05 +0100
Subject: [PATCH] DEV: tcploop: do not report an error on POLLERR

Actually this breaks certain client tests where the server closes with
RST, it prevents from reading the final data so better not abort on
that.
---
 dev/tcploop/tcploop.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/dev/tcploop/tcploop.c b/dev/tcploop/tcploop.c
index 9956835a9..e87525887 100644
--- a/dev/tcploop/tcploop.c
+++ b/dev/tcploop/tcploop.c
@@ -306,7 +306,7 @@ int addr_to_ss(const char *str, struct sockaddr_storage *ss, struct err_msg *err
 }
 
 /* waits up to <ms> milliseconds on fd <fd> for events <events> (POLLIN|POLLRDHUP|POLLOUT).
- * returns poll's status, or -2 if the poller sets POLLERR.
+ * returns poll's status.
  */
 int wait_on_fd(int fd, int events, int ms)
 {
@@ -319,8 +319,6 @@ int wait_on_fd(int fd, int events, int ms)
 		ret = poll(&pollfd, 1, ms);
 	} while (ret == -1 && errno == EINTR);
 
-	if (ret == 1 && pollfd.revents & POLLERR)
-		ret = -2;
 	return ret;
 }