[alsa-devel] [PATCH] snd_mixer_poll_descriptors_revents: iterate over all descriptors

Takashi Iwai tiwai at suse.de
Mon Aug 8 09:18:56 CEST 2011


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


More information about the Alsa-devel mailing list