]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: Don't reject O_RDWR at opening PCM OSS
authorTakashi Iwai <tiwai@suse.de>
Fri, 4 Aug 2006 18:37:33 +0000 (20:37 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 7 Aug 2006 03:52:16 +0000 (20:52 -0700)
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: Greg Kroah-Hartman <gregkh@suse.de>
sound/core/oss/pcm_oss.c

index ac990bf0b48f7ab11f5684d56b25fae795bd4d5e..785a2acd9adf3119a53e69b353b7d1632240a189 100644 (file)
@@ -1745,6 +1745,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;