mirror of https://github.com/ericonr/sndio.git
poll the right number of descriptors
This commit is contained in:
parent
03907f98dc
commit
8d3f1fbe70
|
@ -223,8 +223,13 @@ sio_psleep(struct sio_hdl *hdl, int event)
|
|||
nfds_t nfds;
|
||||
|
||||
nfds = sio_nfds(hdl);
|
||||
if (nfds > SIO_MAXNFDS) {
|
||||
DPRINTF("sio_psleep: %d: too many descriptors\n", nfds);
|
||||
hdl->eof = 1;
|
||||
return 0;
|
||||
}
|
||||
for (;;) {
|
||||
sio_pollfd(hdl, pfd, event);
|
||||
nfds = sio_pollfd(hdl, pfd, event);
|
||||
while (poll(pfd, nfds, -1) < 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue