fix device openning mode. defaults to write only, but read/write can be

selected using -sndrw
This commit is contained in:
Bill Currie 2001-05-16 18:57:54 +00:00
parent d97095fe87
commit f3e7e4d1bc

View file

@ -80,11 +80,14 @@ SNDDMA_Init (void)
struct audio_buf_info info;
int caps;
int retries = 3;
int omode = O_WRONLY;
snd_inited = 0;
// open /dev/dsp, confirm capability to mmap, and get size of dma buffer
audio_fd = open ("/dev/dsp", O_RDWR);
if (COM_CheckParm ("-sndrw"))
omode = O_RDWR;
audio_fd = open ("/dev/dsp", omode);
if (audio_fd < 0) { // Failed open, retry up to 3 times
// if it's busy
while ((audio_fd < 0) && retries-- &&