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)
This commit is contained in:
Wojciech A. Koszek 2006-03-27 00:46:22 +00:00
parent 8f2937b824
commit ea3d97ae67

View File

@ -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;