mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Added POLLNVAL to poll->events
This commit is contained in:
parent
d0526d603c
commit
098932ce57
7 changed files with 12 additions and 12 deletions
|
|
@ -178,7 +178,7 @@ int snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int s
|
|||
assert(ctl && pfds);
|
||||
if (space > 0) {
|
||||
pfds->fd = ctl->poll_fd;
|
||||
pfds->events = POLLIN|POLLERR;
|
||||
pfds->events = POLLIN|POLLERR|POLLNVAL;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -265,13 +265,13 @@ int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned
|
|||
pfds->fd = hwdep->poll_fd;
|
||||
switch (hwdep->mode & O_ACCMODE) {
|
||||
case O_WRONLY:
|
||||
pfds->events = POLLOUT|POLLERR;
|
||||
pfds->events = POLLOUT|POLLERR|POLLNVAL;
|
||||
break;
|
||||
case O_RDONLY:
|
||||
pfds->events = POLLIN|POLLERR;
|
||||
pfds->events = POLLIN|POLLERR|POLLNVAL;
|
||||
break;
|
||||
case O_RDWR:
|
||||
pfds->events = POLLOUT|POLLIN|POLLERR;
|
||||
pfds->events = POLLOUT|POLLIN|POLLERR|POLLNVAL;
|
||||
break;
|
||||
default:
|
||||
return -EIO;
|
||||
|
|
|
|||
|
|
@ -616,7 +616,7 @@ int snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds,
|
|||
return -EINVAL;
|
||||
res = 0;
|
||||
for (idx = 0; idx < nfds; idx++)
|
||||
res |= pfds->revents & (POLLIN|POLLERR);
|
||||
res |= pfds->revents & (POLLIN|POLLERR|POLLNVAL);
|
||||
*revents = res;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1178,7 +1178,7 @@ int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int s
|
|||
assert(pcm && pfds);
|
||||
if (space >= 1 && pfds) {
|
||||
pfds->fd = pcm->poll_fd;
|
||||
pfds->events = pcm->stream == SND_PCM_STREAM_PLAYBACK ? (POLLOUT|POLLERR) : (POLLIN|POLLERR);
|
||||
pfds->events = pcm->stream == SND_PCM_STREAM_PLAYBACK ? (POLLOUT|POLLERR|POLLNVAL) : (POLLIN|POLLERR|POLLNVAL);
|
||||
} else
|
||||
return 0;
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rawmidi, struct pollfd *pfds, un
|
|||
assert(rawmidi);
|
||||
if (space >= 1) {
|
||||
pfds->fd = rawmidi->poll_fd;
|
||||
pfds->events = rawmidi->stream == SND_RAWMIDI_STREAM_OUTPUT ? (POLLOUT|POLLERR) : (POLLIN|POLLERR);
|
||||
pfds->events = rawmidi->stream == SND_RAWMIDI_STREAM_OUTPUT ? (POLLOUT|POLLERR|POLLNVAL) : (POLLIN|POLLERR|POLLNVAL);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -315,11 +315,11 @@ int snd_seq_poll_descriptors(snd_seq_t *seq, struct pollfd *pfds, unsigned int s
|
|||
assert(seq);
|
||||
if ((events & POLLIN) && space >= 1) {
|
||||
assert(seq->streams & SND_SEQ_OPEN_INPUT);
|
||||
revents |= POLLIN|POLLERR;
|
||||
revents |= POLLIN|POLLERR|POLLNVAL;
|
||||
}
|
||||
if ((events & POLLOUT) && space >= 1) {
|
||||
assert(seq->streams & SND_SEQ_OPEN_OUTPUT);
|
||||
revents |= POLLOUT|POLLERR;
|
||||
revents |= POLLOUT|POLLERR|POLLNVAL;
|
||||
}
|
||||
if (!revents)
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -297,13 +297,13 @@ int snd_timer_poll_descriptors(snd_timer_t *timer, struct pollfd *pfds, unsigned
|
|||
pfds->fd = timer->poll_fd;
|
||||
switch (timer->mode & O_ACCMODE) {
|
||||
case O_WRONLY:
|
||||
pfds->events = POLLOUT|POLLERR;
|
||||
pfds->events = POLLOUT|POLLERR|POLLNVAL;
|
||||
break;
|
||||
case O_RDONLY:
|
||||
pfds->events = POLLIN|POLLERR;
|
||||
pfds->events = POLLIN|POLLERR|POLLNVAL;
|
||||
break;
|
||||
case O_RDWR:
|
||||
pfds->events = POLLOUT|POLLIN|POLLERR;
|
||||
pfds->events = POLLOUT|POLLIN|POLLERR|POLLNVAL;
|
||||
break;
|
||||
default:
|
||||
return -EIO;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue