diff --git a/libsndio/siomix_sun.c b/libsndio/siomix_sun.c index 066fe8a..2ac79d7 100644 --- a/libsndio/siomix_sun.c +++ b/libsndio/siomix_sun.c @@ -392,7 +392,7 @@ siomix_sun_setctl(struct siomix_hdl *arg, unsigned int addr, unsigned int val) static int siomix_sun_nfds(struct siomix_hdl *addr) { - return 0; + return 1; } static int @@ -401,6 +401,8 @@ siomix_sun_pollfd(struct siomix_hdl *addr, struct pollfd *pfd, int events) struct siomix_sun_hdl *hdl = (struct siomix_sun_hdl *)addr; hdl->events = events; + pfd->events = 0; + pfd->fd = hdl->fd; return 0; } @@ -409,6 +411,6 @@ siomix_sun_revents(struct siomix_hdl *addr, struct pollfd *pfd) { struct siomix_sun_hdl *hdl = (struct siomix_sun_hdl *)addr; - return hdl->events & POLLOUT; + return pfd->revents | (hdl->events & POLLOUT); } #endif