Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Oct 2008 05:12:50 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184070 - head/sbin/geom/class/part
Message-ID:  <200810200512.m9K5CoPv061024@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810200512.m9K5CoPv061024>