diff options
| author | kre <kre@NetBSD.org> | 2017-07-25 21:25:03 +0000 |
|---|---|---|
| committer | kre <kre@NetBSD.org> | 2017-07-25 21:25:03 +0000 |
| commit | 1cb09b322285cb2bcfa2bb267672741c8eb7c923 (patch) | |
| tree | 01caf5100413581cacbafdd0c14b7e5cb5bd85e1 /tests/usr.bin | |
| parent | bb2a1014ca06bd6580d97a6ac045c96a2fcadb1d (diff) | |
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...
Diffstat (limited to 'tests/usr.bin')
| -rw-r--r-- | tests/usr.bin/mixerctl/t_mixerctl.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/usr.bin/mixerctl/t_mixerctl.sh b/tests/usr.bin/mixerctl/t_mixerctl.sh index 62bb4d28c50..aa43deca03d 100644 --- a/tests/usr.bin/mixerctl/t_mixerctl.sh +++ b/tests/usr.bin/mixerctl/t_mixerctl.sh @@ -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" |
