mirror of https://github.com/ericonr/sndio.git
siomix_sun: poll the mixer fd to detect when device is gone.
This doesn't work yet, as the audio(4) driver doesn't properly wakeup processes waiting in the poll syscall, see audio_detach()
This commit is contained in:
parent
aefc78f715
commit
aceffe4729
|
@ -392,7 +392,7 @@ siomix_sun_setctl(struct siomix_hdl *arg, unsigned int addr, unsigned int val)
|
||||||
static int
|
static int
|
||||||
siomix_sun_nfds(struct siomix_hdl *addr)
|
siomix_sun_nfds(struct siomix_hdl *addr)
|
||||||
{
|
{
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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;
|
struct siomix_sun_hdl *hdl = (struct siomix_sun_hdl *)addr;
|
||||||
|
|
||||||
hdl->events = events;
|
hdl->events = events;
|
||||||
|
pfd->events = 0;
|
||||||
|
pfd->fd = hdl->fd;
|
||||||
return 0;
|
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;
|
struct siomix_sun_hdl *hdl = (struct siomix_sun_hdl *)addr;
|
||||||
|
|
||||||
return hdl->events & POLLOUT;
|
return pfd->revents | (hdl->events & POLLOUT);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue