svn commit: r218677 - head/sbin/mdconfig

Bruce Cran brucec at FreeBSD.org
Mon Feb 14 09:58:48 UTC 2011


Author: brucec
Date: Mon Feb 14 09:58:47 2011
New Revision: 218677
URL: http://svn.freebsd.org/changeset/base/218677

Log:
  Add a check to make sure the provider name is "mdN" before printing the
  unit number.
  
  Suggested by: 	jh
  MFC after:	3 days

Modified:
  head/sbin/mdconfig/mdconfig.c

Modified: head/sbin/mdconfig/mdconfig.c
==============================================================================
--- head/sbin/mdconfig/mdconfig.c	Mon Feb 14 08:14:06 2011	(r218676)
+++ head/sbin/mdconfig/mdconfig.c	Mon Feb 14 09:58:47 2011	(r218677)
@@ -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)


More information about the svn-src-head mailing list