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!
This commit is contained in:
Alexandre Ratchov 2012-01-10 09:11:10 +01:00
parent ba61afa867
commit d5ee44fc8b
1 changed files with 5 additions and 3 deletions

View File

@ -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':