From ea3d97ae6726dfe042d810e36541eeb57cbef6c6 Mon Sep 17 00:00:00 2001 From: "Wojciech A. Koszek" 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(+) (limited to 'sbin/mdconfig') diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c index ed781763f3d2..280219fcb5d6 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.2.3