]> err.no Git - linux-2.6/commitdiff
[ALSA] Don't reject O_RDWR at opening PCM OSS with read/write-only device
authorTakashi Iwai <tiwai@suse.de>
Wed, 2 Aug 2006 19:12:09 +0000 (21:12 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 3 Aug 2006 13:21:31 +0000 (15:21 +0200)
Accept O_RDWR at opening a PCM OSS device that is read- or write-only,
just for the compatibility with the behavior of older versions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/core/oss/pcm_oss.c

index f5ff4f4a16ee0b7964599c49f1311176dc7a6aa1..472fce0ee0e8111210e68ead84424f4f477635f2 100644 (file)
@@ -2228,6 +2228,8 @@ static int snd_pcm_oss_open_file(struct file *file,
        for (idx = 0; idx < 2; idx++) {
                if (setup[idx].disable)
                        continue;
+               if (! pcm->streams[idx].substream_count)
+                       continue; /* no matching substream */
                if (idx == SNDRV_PCM_STREAM_PLAYBACK) {
                        if (! (f_mode & FMODE_WRITE))
                                continue;