diff options
author | brucec <brucec@FreeBSD.org> | 2011-02-14 09:58:47 +0000 |
---|---|---|
committer | brucec <brucec@FreeBSD.org> | 2011-02-14 09:58:47 +0000 |
commit | 47e21cfa40f8c241162117bc50be489177a3c078 (patch) | |
tree | d8c1a6300f5f3b1823d7e40559655d826643e216 | |
parent | 6df3ab97b9091b570163b18e344f69ce384e8e18 (diff) | |
download | FreeBSD-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
-rw-r--r-- | sbin/mdconfig/mdconfig.c | 6 |
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) |