summaryrefslogtreecommitdiffstats
path: root/sbin/geom
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-10-20 05:12:50 +0000
committermarcel <marcel@FreeBSD.org>2008-10-20 05:12:50 +0000
commit48fb5445ab0284d7e1053037731bebf18926a16a (patch)
tree7f10f665158d7a475bd5804e823bb95cafc2189a /sbin/geom
parent491c7479e7367e870a1911a9b9c7a0c3069b648a (diff)
downloadFreeBSD-src-48fb5445ab0284d7e1053037731bebf18926a16a.zip
FreeBSD-src-48fb5445ab0284d7e1053037731bebf18926a16a.tar.gz
Add support for multiple attributes. This is required for the
PC98 scheme.
Diffstat (limited to 'sbin/geom')
-rw-r--r--sbin/geom/class/part/geom_part.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sbin/geom/class/part/geom_part.c b/sbin/geom/class/part/geom_part.c
index 19d4157..2d03ae1 100644
--- a/sbin/geom/class/part/geom_part.c
+++ b/sbin/geom/class/part/geom_part.c
@@ -223,13 +223,20 @@ fmtsize(long double rawsz)
static const char *
fmtattrib(struct gprovider *pp)
{
- static char buf[64];
- const char *val;
+ static char buf[128];
+ struct gconfig *gc;
+ u_int idx;
- val = find_provcfg(pp, "attrib");
- if (val == NULL)
- return ("");
- snprintf(buf, sizeof(buf), " [%s] ", val);
+ 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);
}
OpenPOWER on IntegriCloud