svn commit: r184070 - head/sbin/geom/class/part

Marcel Moolenaar marcel at FreeBSD.org
Mon Oct 20 05:12:51 UTC 2008


Author: marcel
Date: Mon Oct 20 05:12:50 2008
New Revision: 184070
URL: http://svn.freebsd.org/changeset/base/184070

Log:
  Add support for multiple attributes. This is required for the
  PC98 scheme.

Modified:
  head/sbin/geom/class/part/geom_part.c

Modified: head/sbin/geom/class/part/geom_part.c
==============================================================================
--- head/sbin/geom/class/part/geom_part.c	Mon Oct 20 04:50:47 2008	(r184069)
+++ head/sbin/geom/class/part/geom_part.c	Mon Oct 20 05:12:50 2008	(r184070)
@@ -223,13 +223,20 @@ fmtsize(long double rawsz)
 static const char *
 fmtattrib(struct gprovider *pp)
 {
-	static char buf[64];
-	const char *val;
-
-	val = find_provcfg(pp, "attrib");
-	if (val == NULL)
-		return ("");
-	snprintf(buf, sizeof(buf), " [%s] ", val);
+	static char buf[128];
+	struct gconfig *gc;
+	u_int idx;
+
+	buf[0] = '\0';
+	idx = 0;
+	LIST_FOREACH(gc, &pp->lg_config, lg_config) {
+		if (strcmp(gc->lg_name, "attrib") != 0)
+			continue;
+		idx += snprintf(buf + idx, sizeof(buf) - idx, "%s%s",
+		    (idx == 0) ? " [" : ",", gc->lg_val);
+	}
+	if (idx > 0)
+		snprintf(buf + idx, sizeof(buf) - idx, "] ");
 	return (buf);
 }
 


More information about the svn-src-all mailing list