diff options
author | marcel <marcel@FreeBSD.org> | 2008-10-20 05:12:50 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2008-10-20 05:12:50 +0000 |
commit | 48fb5445ab0284d7e1053037731bebf18926a16a (patch) | |
tree | 7f10f665158d7a475bd5804e823bb95cafc2189a /sbin | |
parent | 491c7479e7367e870a1911a9b9c7a0c3069b648a (diff) | |
download | FreeBSD-src-48fb5445ab0284d7e1053037731bebf18926a16a.zip FreeBSD-src-48fb5445ab0284d7e1053037731bebf18926a16a.tar.gz |
Add support for multiple attributes. This is required for the
PC98 scheme.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/geom/class/part/geom_part.c | 19 |
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); } |