From d5ee44fc8bf194d7294d5183de47b540a79828ae Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Tue, 10 Jan 2012 09:11:10 +0100 Subject: [PATCH] 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! --- aucat/aucat.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aucat/aucat.c b/aucat/aucat.c index 83fdfec..f370d6a 100644 --- a/aucat/aucat.c +++ b/aucat/aucat.c @@ -506,9 +506,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':