From 9c74b5d797cf34116eed754728ce27390ca76530 Mon Sep 17 00:00:00 2001 From: wkoszek Date: Mon, 27 Mar 2006 00:46:22 +0000 Subject: 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) --- sbin/mdconfig/mdconfig.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- cgit v1.1