diff options
author | Darren Tucker <dtucker@dtucker.net> | 2021-09-08 18:39:44 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2021-09-08 18:39:44 +1000 |
commit | b6255593ed5ccbe5e7d3d4b26b2ad31ad4afc232 (patch) | |
tree | a99bb44ca2441aa3f7bd720122a80b5ac6f62e09 | |
parent | a3e92a6794817df6012ac8546aea19652cc91b61 (diff) |
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.
-rw-r--r-- | openbsd-compat/bsd-pselect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/bsd-pselect.c b/openbsd-compat/bsd-pselect.c index fff1bf54..b3632086 100644 --- a/openbsd-compat/bsd-pselect.c +++ b/openbsd-compat/bsd-pselect.c @@ -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. */ |