[alsa-devel] [PATCH] snd_mixer_poll_descriptors_revents: iterate over all descriptors
Hello,
Reading the method snd_mixer_poll_descriptors_revents, it seems to me that the iteration over the array 'pfds' is wrong. Shouldn't the attached patch be applied?
Regards, Olivier
At Thu, 4 Aug 2011 12:06:19 +0200, Olivier Trichet wrote:
[1 <text/plain; utf-8 (7bit)>] Hello,
Reading the method snd_mixer_poll_descriptors_revents, it seems to me that the iteration over the array 'pfds' is wrong. Shouldn't the attached patch be applied?
Regards, Olivier [2 0001-snd_mixer_poll_descriptors_revents-iterate-over-all-.patch <text/x-patch; utf-8 (quoted-printable)>] diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c index 85d843f..c3269ea 100644 --- a/src/mixer/mixer.c +++ b/src/mixer/mixer.c @@ -744,7 +744,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|POLLNVAL);
res |= pfds[i]->revents & (POLLIN|POLLERR|POLLNVAL);
You mean idx instead of i, right?
thanks,
Takashi
Le lundi 8 août 2011 09:18:56, Takashi Iwai a écrit :
At Thu, 4 Aug 2011 12:06:19 +0200,
Olivier Trichet wrote:
[1 <text/plain; utf-8 (7bit)>] Hello,
Reading the method snd_mixer_poll_descriptors_revents, it seems to me that the iteration over the array 'pfds' is wrong. Shouldn't the attached patch be applied?
Regards, Olivier [2 0001-snd_mixer_poll_descriptors_revents-iterate-over-all-.patch <text/x-patch; utf-8 (quoted-printable)>] diff --git a/src/mixer/mixer.c b/src/mixer/mixer.c index 85d843f..c3269ea 100644 --- a/src/mixer/mixer.c +++ b/src/mixer/mixer.c @@ -744,7 +744,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|POLLNVAL);
res |= pfds[i]->revents & (POLLIN|POLLERR|POLLNVAL);
You mean idx instead of i, right?
I even meant pdfs[idx].revents instead of pdfs[i]->revents. Sorry.
Thanks for having a look. Olivier
participants (2)
-
Olivier Trichet
-
Takashi Iwai