From 5274a0fe19c84b73a09d87cb7fbe42b7571a23f2 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Tue, 3 May 2022 13:05:51 +0200 Subject: [PATCH] [win32] minor optimisation --- src/osdep/win32/overrides.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osdep/win32/overrides.c b/src/osdep/win32/overrides.c index 5d4864432..3f7ee7714 100644 --- a/src/osdep/win32/overrides.c +++ b/src/osdep/win32/overrides.c @@ -604,7 +604,7 @@ select_one_loop(int num_fds, struct fd_set *rd, struct fd_set *wr, FD_SET(fd - SOCK_SHIFT, &sock_wr); FD_SET(fd - SOCK_SHIFT, &sock_ex); - sel_rc = select(fd + 1, &sock_rd, NULL, NULL, &tv); + sel_rc = select(fd - SOCK_SHIFT + 1, &sock_rd, NULL, NULL, &tv); if (sel_rc > 0) { FD_SET(fd, rd); rc++; @@ -613,7 +613,7 @@ select_one_loop(int num_fds, struct fd_set *rd, struct fd_set *wr, } if (wr) { - sel_rc = select(fd + 1, NULL, &sock_wr, NULL, &tv); + sel_rc = select(fd - SOCK_SHIFT + 1, NULL, &sock_wr, NULL, &tv); if (sel_rc > 0) { FD_SET (fd, wr); rc++; @@ -622,7 +622,7 @@ select_one_loop(int num_fds, struct fd_set *rd, struct fd_set *wr, } } - sel_rc = select(fd + 1, NULL, NULL, &sock_ex, &tv); + sel_rc = select(fd - SOCK_SHIFT + 1, NULL, NULL, &sock_ex, &tv); if (sel_rc > 0) { FD_SET (fd, ex); rc++;