diff options
author | phk <phk@FreeBSD.org> | 2001-01-31 08:41:18 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-01-31 08:41:18 +0000 |
commit | c276446c27b0fa9eca7b39c089fd2bf663a59212 (patch) | |
tree | 398dbf9ccae2845e3ef5d9ac79066b86728ec4d8 /sbin/mdconfig/mdconfig.c | |
parent | 65ffeedc026ab274d1157e89fa7df9108c6aadd9 (diff) | |
download | FreeBSD-src-c276446c27b0fa9eca7b39c089fd2bf663a59212.zip FreeBSD-src-c276446c27b0fa9eca7b39c089fd2bf663a59212.tar.gz |
Strip optional prefixes "/dev/" and "md" from the -u argument.
Diffstat (limited to 'sbin/mdconfig/mdconfig.c')
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index a5b777c..b2ea2bb 100644 --- a/sbin/mdconfig/mdconfig.c +++ b/sbin/mdconfig/mdconfig.c @@ -126,6 +126,11 @@ main(int argc, char **argv) case 'u': if (cmdline != 2 && cmdline != 3) usage(); + if (!strncmp(optarg, "/dev/", 5)) + optarg += 5; + if (!strncmp(optarg, "md", 2)) + optarg += 2; + mdio.md_unit = strtoul(optarg, NULL, 0); mdio.md_unit = strtoul(optarg, NULL, 0); mdio.md_options &= ~MD_AUTOUNIT; break; |