From: Takashi Iwai Date: Wed, 2 Aug 2006 19:12:09 +0000 (+0200) Subject: [ALSA] Don't reject O_RDWR at opening PCM OSS with read/write-only device X-Git-Tag: v2.6.18-rc4~2^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cb53e7ed77d429531afa8d822d59909f953a771;p=linux-2.6 [ALSA] Don't reject O_RDWR at opening PCM OSS with read/write-only device 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 Signed-off-by: Jaroslav Kysela --- diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index f5ff4f4a16..472fce0ee0 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -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;