aboutsummaryrefslogtreecommitdiff
path: root/sbin/mdconfig/mdconfig.c
diff options
context:
space:
mode:
authorRebecca Cran <brucec@FreeBSD.org>2011-02-14 09:58:47 +0000
committerRebecca Cran <brucec@FreeBSD.org>2011-02-14 09:58:47 +0000
commitc3e257a9e7b254c9c13c41633cb25b6266a8af49 (patch)
treed8c1a6300f5f3b1823d7e40559655d826643e216 /sbin/mdconfig/mdconfig.c
parentf417369bdd33fc3f02df5d49f7c7a9953ecd1bdd (diff)
downloadsrc-c3e257a9e7b254c9c13c41633cb25b6266a8af49.tar.gz
src-c3e257a9e7b254c9c13c41633cb25b6266a8af49.zip
Add a check to make sure the provider name is "mdN" before printing the
unit number. Suggested by: jh MFC after: 3 days
Notes
Notes: svn path=/head/; revision=218677
Diffstat (limited to 'sbin/mdconfig/mdconfig.c')
-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 8ce4334ba744..50c3e96582a7 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)