summaryrefslogtreecommitdiffstats
path: root/sbin/mdconfig
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-01-31 08:41:18 +0000
committerphk <phk@FreeBSD.org>2001-01-31 08:41:18 +0000
commitc276446c27b0fa9eca7b39c089fd2bf663a59212 (patch)
tree398dbf9ccae2845e3ef5d9ac79066b86728ec4d8 /sbin/mdconfig
parent65ffeedc026ab274d1157e89fa7df9108c6aadd9 (diff)
downloadFreeBSD-src-c276446c27b0fa9eca7b39c089fd2bf663a59212.zip
FreeBSD-src-c276446c27b0fa9eca7b39c089fd2bf663a59212.tar.gz
Strip optional prefixes "/dev/" and "md" from the -u argument.
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r--sbin/mdconfig/mdconfig.c5
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;
OpenPOWER on IntegriCloud