poll the right number of descriptors

This commit is contained in:
Alexandre Ratchov 2012-10-05 17:07:18 +02:00
parent 03907f98dc
commit 8d3f1fbe70
1 changed files with 6 additions and 1 deletions

View File

@ -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;