summaryrefslogtreecommitdiffstats
path: root/lib/libsndio/sio.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libsndio/sio.c')
-rw-r--r--lib/libsndio/sio.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libsndio/sio.c b/lib/libsndio/sio.c
index af15bdac0a8..1b1376c7d4f 100644
--- a/lib/libsndio/sio.c
+++ b/lib/libsndio/sio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sio.c,v 1.5 2011/05/06 10:25:17 ratchov Exp $ */
+/* $OpenBSD: sio.c,v 1.6 2011/05/09 17:34:14 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -216,19 +216,21 @@ sio_getcap(struct sio_hdl *hdl, struct sio_cap *cap)
static int
sio_psleep(struct sio_hdl *hdl, int event)
{
- struct pollfd pfd;
+ struct pollfd pfd[SIO_MAXNFDS];
int revents;
+ nfds_t nfds;
+ nfds = sio_nfds(hdl);
for (;;) {
- sio_pollfd(hdl, &pfd, event);
- while (poll(&pfd, 1, -1) < 0) {
+ sio_pollfd(hdl, pfd, event);
+ while (poll(pfd, nfds, -1) < 0) {
if (errno == EINTR)
continue;
DPERROR("sio_psleep: poll");
hdl->eof = 1;
return 0;
}
- revents = sio_revents(hdl, &pfd);
+ revents = sio_revents(hdl, pfd);
if (revents & POLLHUP) {
DPRINTF("sio_psleep: hang-up\n");
return 0;