diff options
| author | Ron Yorston <rmy@pobox.com> | 2025-05-26 14:37:42 +0100 |
|---|---|---|
| committer | Ron Yorston <rmy@pobox.com> | 2025-05-26 14:37:42 +0100 |
| commit | 854c647da7a84cf2aaa2c9a84ff1ca353bdaf9cf (patch) | |
| tree | 5b39adfc5ba8c376917877adf28b6c172ae63812 | |
| parent | 1f29171a25b605bd50fd03698181e7530d81206b (diff) | |
| download | busybox-w32-854c647da7a84cf2aaa2c9a84ff1ca353bdaf9cf.tar.gz busybox-w32-854c647da7a84cf2aaa2c9a84ff1ca353bdaf9cf.tar.bz2 busybox-w32-854c647da7a84cf2aaa2c9a84ff1ca353bdaf9cf.zip | |
win32: update implementation of select(2)
Apply gnulib commit 034af0e401 (select, pselect: Fix test failure
on native Windows).
* lib/select.c (rpl_select): Fail if nfds is out-of-range.
* lib/pselect.c (pselect): Likewise.
| -rw-r--r-- | win32/select.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/win32/select.c b/win32/select.c index 2be221ac8..46a051cfc 100644 --- a/win32/select.c +++ b/win32/select.c | |||
| @@ -273,8 +273,11 @@ mingw_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds, | |||
| 273 | int i, fd, rc; | 273 | int i, fd, rc; |
| 274 | clock_t tend = 0; | 274 | clock_t tend = 0; |
| 275 | 275 | ||
| 276 | if (nfds > FD_SETSIZE) | 276 | if (nfds < 0 || nfds > FD_SETSIZE) |
| 277 | nfds = FD_SETSIZE; | 277 | { |
| 278 | errno = EINVAL; | ||
| 279 | return -1; | ||
| 280 | } | ||
| 278 | 281 | ||
| 279 | if (!timeout) | 282 | if (!timeout) |
| 280 | wait_timeout = INFINITE; | 283 | wait_timeout = INFINITE; |
