From owner-svn-src-all@FreeBSD.ORG Mon Oct 20 05:12:50 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6355106566C; Mon, 20 Oct 2008 05:12:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CB88FC16; Mon, 20 Oct 2008 05:12:50 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9K5Co2p061025; Mon, 20 Oct 2008 05:12:50 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9K5CoPv061024; Mon, 20 Oct 2008 05:12:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200810200512.m9K5CoPv061024@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 20 Oct 2008 05:12:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184070 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 05:12:51 -0000 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); }