summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorwkoszek <wkoszek@FreeBSD.org>2006-03-27 00:46:22 +0000
committerwkoszek <wkoszek@FreeBSD.org>2006-03-27 00:46:22 +0000
commit9c74b5d797cf34116eed754728ce27390ca76530 (patch)
tree7532630469ffcad19c14fb47cda09b03097befd6 /sbin
parentd83e208f26df544c83c6c2e60eabeaba91ce0928 (diff)
downloadFreeBSD-src-9c74b5d797cf34116eed754728ce27390ca76530.zip
FreeBSD-src-9c74b5d797cf34116eed754728ce27390ca76530.tar.gz
For now, bring back some of the old bits as a fix for specifying md(4)
device number at creation time with -u option. Together with XMLizing mdconfig(8), I broke this functionality. This change is temporary. Complete fix will be commited soon. Approved by: cognet (mentor)
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mdconfig/mdconfig.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index ed78176..280219f 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -213,6 +213,13 @@ main(int argc, char **argv)
case 'u':
if (cmdline != 2 && cmdline != 3)
usage();
+ if (!strncmp(optarg, "/dev/", 5))
+ optarg += 5;
+ if (!strncmp(optarg, MD_NAME, sizeof(MD_NAME) - 1))
+ optarg += sizeof(MD_NAME) - 1;
+ mdio.md_unit = strtoul(optarg, &p, 0);
+ if (mdio.md_unit == (unsigned)ULONG_MAX || *p != '\0')
+ errx(1, "bad unit: %s", optarg);
mdunit = optarg;
mdio.md_options &= ~MD_AUTOUNIT;
break;
OpenPOWER on IntegriCloud