diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-01-31 08:41:18 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2001-01-31 08:41:18 +0000 |
commit | fb1023d670001c159ccbf82e0dd05b23f1067580 (patch) | |
tree | 8e0693861116915a3b5e88b1c7b159b7561fc603 /sbin/mdconfig/mdconfig.c | |
parent | 27b57c7e04c8346e729b8a958862918984d0b25f (diff) | |
download | src-fb1023d670001c159ccbf82e0dd05b23f1067580.tar.gz src-fb1023d670001c159ccbf82e0dd05b23f1067580.zip |
Strip optional prefixes "/dev/" and "md" from the -u argument.
Notes
Notes:
svn path=/head/; revision=71865
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 a5b777c37684..b2ea2bbd31a5 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; |