From: jrizzo Date: Tue, 15 Apr 2025 17:57:20 +0000 (-0600) Subject: Fix hang on Windows when multiple --client args are present X-Git-Tag: fio-3.40~27^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=b7be1e420f66a0fe2bf9b22f5a3e9da077330b41;p=fio.git Fix hang on Windows when multiple --client args are present The Windows poll function does not clear revents field before it is populated. As a result, subsequent calls to poll using the same pollfd reference return with revents set even when there is nothing available to read. This later results in a hang in recv(). Signed-off-by: James Rizzo --- diff --git a/os/windows/posix.c b/os/windows/posix.c index 2ce18b8b..e3abf383 100644 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -899,10 +899,9 @@ int poll(struct pollfd fds[], nfds_t nfds, int timeout) FD_ZERO(&exceptfds); for (i = 0; i < nfds; i++) { - if (fds[i].fd == INVALID_SOCKET) { - fds[i].revents = 0; + fds[i].revents = 0; + if (fds[i].fd == INVALID_SOCKET) continue; - } if (fds[i].events & POLLIN) FD_SET(fds[i].fd, &readfds);