From 90bca1e6053d5b981fe014506601416cbbffb040 Mon Sep 17 00:00:00 2001 From: "Aaron M. Ucko" Date: Fri, 10 May 2024 10:05:28 -0400 Subject: [PATCH] tds_select: Treat EAGAIN and EINPROGRESS like EINTR. Call the registered interrupt handler (if any) for all three. Signed-off-by: Aaron M. Ucko --- src/tds/net.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tds/net.c b/src/tds/net.c index 466776c0b3..e9b4ba7fe9 100644 --- a/src/tds/net.c +++ b/src/tds/net.c @@ -671,6 +671,8 @@ tds_select(TDSSOCKET * tds, unsigned tds_sel, int timeout_seconds) switch (sock_errno) { case TDSSOCK_EINTR: + case EAGAIN: + case TDSSOCK_EINPROGRESS: /* FIXME this should be global maximun, not loop one */ seconds += poll_seconds; break; /* let interrupt handler be called */ @@ -683,7 +685,10 @@ tds_select(TDSSOCKET * tds, unsigned tds_sel, int timeout_seconds) } } - assert(rc == 0 || (rc < 0 && sock_errno == TDSSOCK_EINTR)); + assert(rc == 0 || (rc < 0 && (sock_errno == TDSSOCK_EINTR || + sock_errno == EAGAIN || + sock_errno == TDSSOCK_EINPROGRESS + ))); if (tds_get_ctx(tds) && tds_get_ctx(tds)->int_handler) { /* interrupt handler installed */ /*