Allow for fd = -1 in compat ppoll overflow check.

Fixes tests on at least FreeBSD 6, possibly others.
This commit is contained in:
Darren Tucker 2021-11-19 18:53:46 +11:00
parent 04b172da5b
commit b7ffbb17e3
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *tmoutp,
for (i = 0; i < nfds; i++) { for (i = 0; i < nfds; i++) {
fd = fds[i].fd; fd = fds[i].fd;
if (fd >= FD_SETSIZE) { if (fd != -1 && fd >= FD_SETSIZE) {
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }