Re: Sound ioctl mmap/trigger broken in 2.1.80?

Craig Schlenter (craig@is.co.za)
Wed, 21 Jan 1998 09:32:40 +0200 (SAT)


> Here is the relevant snippets of code from amp:
> [snip]
> if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &apar) == -1) {
> perror("ioctl: SNDCTL_DSP_GETCAPS");
> return -1;
> }
> if (!(apar & DSP_CAP_TRIGGER) || !(apar & DSP_CAP_MMAP)) {
> fprintf(stderr, "Sound driver does not support mmap and/or
> trigger\n");
> return -1;
> }
> [snip]

I figured it out ... the code in drivers/sound/audio.c does this:
case SNDCTL_DSP_GETCAPS:
info = 1 | DSP_CAP_MMAP;
[snip, couple more tweaks to info variable]
break;
[and then]
return put_user(val, (int *)arg);

I think a quick s/info/val should do the trick ....

Cheers,

--Craig