The AUDIO_MIXER_WRITE ioctl always succeeds without blocking, so no
need to use poll(2) for output. The audio(4) control device driver
doesn't implement the corresponding struct filterops anyway.
Fixes delayed level settings.
{
struct sioctl_sun_hdl *hdl = (struct sioctl_sun_hdl *)addr;
+ hdl->events = events;
+
+ /*
+ * The audio(4) driver doesn't support POLLOUT, so if it is
+ * requested, don't set the struct pollfd. The AUDIO_MIXER_WRITE
+ * ioctl never blocks, so just return POLLOUT in sioctl_sun_revents().
+ */
+ if (events & POLLOUT)
+ return 0;
+
pfd->fd = hdl->fd;
pfd->events = POLLIN;
- hdl->events = events;
return 1;
}
struct volume *vol;
int idx, n;
+ if (hdl->events & POLLOUT)
+ return POLLOUT;
+
if (pfd->revents & POLLIN) {
while (1) {
n = read(hdl->fd, &idx, sizeof(int));
return POLLHUP;
}
}
- return hdl->events & POLLOUT;
+ return 0;
}