Module Name:    src
Committed By:   kre
Date:           Tue Jul 25 21:25:03 UTC 2017

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

Log Message:
Correct oversight in previous ... redirecting into a compound statement
causes the shell to exit if the redirect fails (posix says "may exit"
and /bin/sh does - maybe should give that more thought) - which will
happen if /dev/pad0 does not exist, causing a very messy test abort
(the shell running the test is not supposed to just go away).  So
check tha the device exista and is readable before attempting to open it.

Problem brought to my attention by nat@ - thanks...


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 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.8 src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.9
--- src/tests/usr.bin/mixerctl/t_mixerctl.sh:1.8	Tue Jul 18 13:17:37 2017
+++ src/tests/usr.bin/mixerctl/t_mixerctl.sh	Tue Jul 25 21:25:03 2017
@@ -1,4 +1,4 @@
-# $NetBSD: t_mixerctl.sh,v 1.8 2017/07/18 13:17:37 kre Exp $
+# $NetBSD: t_mixerctl.sh,v 1.9 2017/07/25 21:25:03 kre Exp $
 
 audio_setup() {
 	# Open /dev/pad0 so we have a configured audio device.
@@ -21,7 +21,8 @@ audio_setup() {
 	# variables, we would need to put $padpid in a file.)
 
 	unset padpid
-	{ { cat >/dev/null & } < /dev/pad0 ; } 2>/dev/null && padpid=$!
+	test -r /dev/pad0 && 
+	    { { cat >/dev/null & } < /dev/pad0 ; } 2>/dev/null && padpid=$!
 
 	(</dev/mixer) >/dev/null 2>&1 ||
 	    atf_skip "no audio mixer available in kernel"

Reply via email to