Module Name:    src
Committed By:   martin
Date:           Wed Mar 21 12:13:31 UTC 2018

Modified Files:
        src/usr.bin/audiocfg [netbsd-7]: audiodev.c

Log Message:
Apply patch, requested by mrg in ticket #1588:

Try to open the audio path with O_WRONLY if O_RDWR fails.
This makes 'audiocfg list' work in more places.

(no longer necessary in -current with the in kernel mixer.)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.4.1 src/usr.bin/audiocfg/audiodev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/audiocfg/audiodev.c
diff -u src/usr.bin/audiocfg/audiodev.c:1.5 src/usr.bin/audiocfg/audiodev.c:1.5.4.1
--- src/usr.bin/audiocfg/audiodev.c:1.5	Sun Aug 11 06:31:00 2013
+++ src/usr.bin/audiocfg/audiodev.c	Wed Mar 21 12:13:30 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: audiodev.c,v 1.5 2013/08/11 06:31:00 dholland Exp $ */
+/* $NetBSD: audiodev.c,v 1.5.4.1 2018/03/21 12:13:30 martin Exp $ */
 
 /*
  * Copyright (c) 2010 Jared D. McNeill <jmcne...@invisible.ca>
@@ -89,8 +89,11 @@ audiodev_getinfo(struct audiodev *adev)
 		adev->defaultdev = true;
 
 	adev->fd = open(adev->path, O_RDWR);
-	if (adev->fd == -1)
-		return -1;
+	if (adev->fd == -1) {
+		adev->fd = open(adev->path, O_WRONLY);
+		if (adev->fd == -1)
+			return -1;
+	}
 	if (ioctl(adev->fd, AUDIO_GETDEV, &adev->audio_device) == -1) {
 		close(adev->fd);
 		return -1;

Reply via email to