Increment nfds when coming from startup_pipe.

If we have to increase nfds because startup_pipe[0] is above any of the
descriptors passed in the fd_sets, we also need to add 1 to nfds since
select takes highest FD number plus one.  bz#3345 from yaroslav.kuzmin
at vmssoftware.com.
This commit is contained in:
Darren Tucker 2021-09-08 18:39:44 +10:00
parent a3e92a6794
commit b6255593ed
1 changed files with 1 additions and 1 deletions

View File

@ -188,7 +188,7 @@ pselect(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
if (unmasked) {
pselect_notify_setup();
pselect_notify_prepare(readfds);
nfds = MAX(nfds, notify_pipe[0]);
nfds = MAX(nfds, notify_pipe[0] + 1);
}
/* Unmask signals, call select then restore signal mask. */