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); dev_adjpar(d, w->mode, &w->hpar, NULL);
break; break;
case 's': case 's':
d = mkdev(DEFAULT_DEV, 0, bufsz, round, 1, autovol); if ((d = dev_list) == NULL) {
mkopt(optarg, d, &rpar, &ppar, d = mkdev(DEFAULT_DEV, 0, bufsz, round,
mode, vol, mmc, join); hold, autovol);
}
mkopt(optarg, d, &rpar, &ppar, mode, vol, mmc, join);
/* XXX: set device rate, if never set */ /* XXX: set device rate, if never set */
break; break;
case 'q': case 'q':