summaryrefslogtreecommitdiffstats
path: root/sbin/mdconfig
diff options
context:
space:
mode:
authorbrucec <brucec@FreeBSD.org>2011-02-14 09:58:47 +0000
committerbrucec <brucec@FreeBSD.org>2011-02-14 09:58:47 +0000
commit47e21cfa40f8c241162117bc50be489177a3c078 (patch)
treed8c1a6300f5f3b1823d7e40559655d826643e216 /sbin/mdconfig
parent6df3ab97b9091b570163b18e344f69ce384e8e18 (diff)
downloadFreeBSD-src-47e21cfa40f8c241162117bc50be489177a3c078.zip
FreeBSD-src-47e21cfa40f8c241162117bc50be489177a3c078.tar.gz
Add a check to make sure the provider name is "mdN" before printing the
unit number. Suggested by: jh MFC after: 3 days
Diffstat (limited to 'sbin/mdconfig')
-rw-r--r--sbin/mdconfig/mdconfig.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/mdconfig/mdconfig.c b/sbin/mdconfig/mdconfig.c
index 8ce4334..50c3e96 100644
--- a/sbin/mdconfig/mdconfig.c
+++ b/sbin/mdconfig/mdconfig.c
@@ -373,7 +373,11 @@ md_list(char *units, int opt)
found = 1;
}
gc = &pp->lg_config;
- printf("%s", nflag ? pp->lg_name + 2 : pp->lg_name);
+ if (nflag && strncmp(pp->lg_name, "md", 2) == 0)
+ printf("%s", pp->lg_name + 2);
+ else
+ printf("%s", pp->lg_name);
+
if (opt & OPT_VERBOSE || opt & OPT_UNIT) {
type = geom_config_get(gc, "type");
if (strcmp(type, "vnode") == 0)
OpenPOWER on IntegriCloud