diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2012-01-10 08:04:20 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2012-01-10 08:04:20 +0000 |
commit | 4c589b84699c6231c250b782fc58961ea29f052d (patch) | |
tree | 4b904c5aa26af9fdb67ba4fbd4c39d81f92a6fa2 | |
parent | 3ad130e36d63ef5e861a4b219d947f55746c697f (diff) |
When a sub-device is created (-s), check if a hardware
device was already created (-f) before trying to use the
default one, otherwise all sub-devices end up attached
to the default device. Noticed by peters at schwertfisch.de,
thanks!
-rw-r--r-- | usr.bin/aucat/aucat.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c index 137cd8c7ea2..edfeb2484f9 100644 --- a/usr.bin/aucat/aucat.c +++ b/usr.bin/aucat/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.130 2011/12/09 22:56:35 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.131 2012/01/10 08:04:19 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -505,9 +505,11 @@ main(int argc, char **argv) dev_adjpar(d, w->mode, &w->hpar, NULL); break; case 's': - d = mkdev(DEFAULT_DEV, 0, bufsz, round, 1, autovol); - mkopt(optarg, d, &rpar, &ppar, - mode, vol, mmc, join); + if ((d = dev_list) == NULL) { + d = mkdev(DEFAULT_DEV, 0, bufsz, round, + hold, autovol); + } + mkopt(optarg, d, &rpar, &ppar, mode, vol, mmc, join); /* XXX: set device rate, if never set */ break; case 'q': |