From owner-svn-src-all@FreeBSD.ORG Thu Mar 10 08:24:33 2011 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 A3FDE106566B; Thu, 10 Mar 2011 08:24:33 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A0748FC14; Thu, 10 Mar 2011 08:24:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2A8OXA1036469; Thu, 10 Mar 2011 08:24:33 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2A8OX4q036466; Thu, 10 Mar 2011 08:24:33 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201103100824.p2A8OX4q036466@svn.freebsd.org> From: Ulrich Spoerlein Date: Thu, 10 Mar 2011 08:24:33 +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: r219449 - head/sbin/bsdlabel 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: Thu, 10 Mar 2011 08:24:33 -0000 Author: uqs Date: Thu Mar 10 08:24:33 2011 New Revision: 219449 URL: http://svn.freebsd.org/changeset/base/219449 Log: Widen fields that display partition offset/length. This makes partitions between 50GiB and 2TiB (16TiB for 4k drives) print correctly aligned. While here, fix type of secsize. g_sectorsize() returns ssize_t, don't store this in an unsigned var. Bump WARNS to 6. MFC after: 4 weeks Modified: head/sbin/bsdlabel/Makefile head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/Makefile ============================================================================== --- head/sbin/bsdlabel/Makefile Thu Mar 10 08:24:21 2011 (r219448) +++ head/sbin/bsdlabel/Makefile Thu Mar 10 08:24:33 2011 (r219449) @@ -12,7 +12,6 @@ LINKS= ${BINDIR}/bsdlabel ${BINDIR}/disk MLINKS= bsdlabel.8 disklabel.8 .endif -WARNS?= 2 DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} LDADD= -lgeom -lbsdxml -lsbuf Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Thu Mar 10 08:24:21 2011 (r219448) +++ head/sbin/bsdlabel/bsdlabel.c Thu Mar 10 08:24:33 2011 (r219449) @@ -105,7 +105,7 @@ static char tmpfil[] = PATH_TMPFILE; static struct disklabel lab; static u_char bootarea[BBSIZE]; static off_t mediasize; -static u_int secsize; +static ssize_t secsize; static char blank[] = ""; static char unknown[] = "unknown"; @@ -589,11 +589,11 @@ display(FILE *f, const struct disklabel } fprintf(f, "%u partitions:\n", lp->d_npartitions); fprintf(f, - "# size offset fstype [fsize bsize bps/cpg]\n"); + "# size offset fstype [fsize bsize bps/cpg]\n"); pp = lp->d_partitions; for (i = 0; i < lp->d_npartitions; i++, pp++) { if (pp->p_size) { - fprintf(f, " %c: %8lu %8lu ", 'a' + i, + fprintf(f, " %c: %10lu %10lu ", 'a' + i, (u_long)pp->p_size, (u_long)pp->p_offset); if (pp->p_fstype < FSMAXTYPES) fprintf(f, "%8.8s", fstypenames[pp->p_fstype]); @@ -602,13 +602,13 @@ display(FILE *f, const struct disklabel switch (pp->p_fstype) { case FS_UNUSED: /* XXX */ - fprintf(f, " %5lu %5lu %5.5s ", + fprintf(f, " %5lu %5lu %2s", (u_long)pp->p_fsize, (u_long)(pp->p_fsize * pp->p_frag), ""); break; case FS_BSDFFS: - fprintf(f, " %5lu %5lu %5u ", + fprintf(f, " %5lu %5lu %5u", (u_long)pp->p_fsize, (u_long)(pp->p_fsize * pp->p_frag), pp->p_cpg);