Module Name:    src
Committed By:   kre
Date:           Tue Jul 25 22:28:22 UTC 2017

Modified Files:
        src/tests/usr.bin/mixerctl: t_mixerctl.sh

Log Message:
Do the previous test a better way - for a file, test is generally
adequate, but for a device, we really need to actually try opening
it to determine that it is possible - so do the test that way, then
if the open succeeds once, assume it will the second time (which then
holds it open.)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/mixerctl/t_mixerctl.sh

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

Modified files:

Index: src/tests/usr.bin/mixerctl/t_mixerctl.sh
diff -u src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.9 src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.10
--- src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.9	Tue Jul 25 21:25:03 2017
+++ src/tests/usr.bin/mixerctl/t_mixerctl.sh	Tue Jul 25 22:28:22 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_mixerctl.sh,v 1.9 2017/07/25 21:25:03 kre Exp $
+# $NetBSD: t_mixerctl.sh,v 1.10 2017/07/25 22:28:22 kre Exp $
 
 audio_setup() {
 	# Open /dev/pad0 so we have a configured audio device.
@@ -21,7 +21,7 @@ audio_setup() {
 	# variables, we would need to put $padpid in a file.)
 
 	unset padpid
-	test -r /dev/pad0 && 
+	( true </dev/pad0 ) >/dev/null 2>&1 &&
 	    { { cat >/dev/null & } < /dev/pad0 ; } 2>/dev/null && padpid=$!
 
 	(</dev/mixer) >/dev/null 2>&1 ||

Reply via email to