aboutsummaryrefslogtreecommitdiff
path: root/sbin/bsdlabel
diff options
context:
space:
mode:
authorUlrich Spörlein <uqs@FreeBSD.org>2011-03-10 08:24:33 +0000
committerUlrich Spörlein <uqs@FreeBSD.org>2011-03-10 08:24:33 +0000
commita58711550d46ef37a3ea9391601c5f96b9376656 (patch)
tree247ab0a9da0edbdd5eb67259c3208ea28d02046f /sbin/bsdlabel
parent4c8dfc4aff08bc3c0fd66e50ee1f51020326d344 (diff)
downloadsrc-a58711550d46ef37a3ea9391601c5f96b9376656.tar.gz
src-a58711550d46ef37a3ea9391601c5f96b9376656.zip
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
Notes
Notes: svn path=/head/; revision=219449
Diffstat (limited to 'sbin/bsdlabel')
-rw-r--r--sbin/bsdlabel/Makefile1
-rw-r--r--sbin/bsdlabel/bsdlabel.c10
2 files changed, 5 insertions, 6 deletions
diff --git a/sbin/bsdlabel/Makefile b/sbin/bsdlabel/Makefile
index c06d2602fc85..e51e928afb24 100644
--- a/sbin/bsdlabel/Makefile
+++ b/sbin/bsdlabel/Makefile
@@ -12,7 +12,6 @@ LINKS= ${BINDIR}/bsdlabel ${BINDIR}/disklabel
MLINKS= bsdlabel.8 disklabel.8
.endif
-WARNS?= 2
DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
LDADD= -lgeom -lbsdxml -lsbuf
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index b666720a2eeb..fbd978a1fa82 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -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 *lp)
}
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 *lp)
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);