From df25a03253a20d8e3c15cf5f78ef28f49b58cb68 Mon Sep 17 00:00:00 2001 From: pjd Date: Mon, 21 Jun 2004 09:20:06 +0000 Subject: Print mediasize in human readable form as well. --- sbin/ggate/ggatec/Makefile | 4 ++-- sbin/ggate/ggatel/Makefile | 4 ++-- sbin/ggate/shared/ggate.c | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'sbin') diff --git a/sbin/ggate/ggatec/Makefile b/sbin/ggate/ggatec/Makefile index e545dff..5674aa1 100644 --- a/sbin/ggate/ggatec/Makefile +++ b/sbin/ggate/ggatec/Makefile @@ -9,7 +9,7 @@ SRCS= ggatec.c ggate.c CFLAGS+= -DLIBGEOM CFLAGS+= -I${.CURDIR}/../shared -DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} -LDADD= -lgeom -lsbuf -lbsdxml +DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL} +LDADD= -lgeom -lsbuf -lbsdxml -lutil .include diff --git a/sbin/ggate/ggatel/Makefile b/sbin/ggate/ggatel/Makefile index 8fb25fa..604a754 100644 --- a/sbin/ggate/ggatel/Makefile +++ b/sbin/ggate/ggatel/Makefile @@ -9,7 +9,7 @@ SRCS= ggatel.c ggate.c CFLAGS+= -DLIBGEOM CFLAGS+= -I${.CURDIR}/../shared -DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} -LDADD= -lgeom -lsbuf -lbsdxml +DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} ${LIBUTIL} +LDADD= -lgeom -lsbuf -lbsdxml -lutil .include diff --git a/sbin/ggate/shared/ggate.c b/sbin/ggate/shared/ggate.c index 51062f7..8eeef2f 100644 --- a/sbin/ggate/shared/ggate.c +++ b/sbin/ggate/shared/ggate.c @@ -45,9 +45,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -259,6 +261,7 @@ static void show_config(struct ggeom *gp, int verbose) { struct gprovider *pp; + char buf[5]; pp = LIST_FIRST(&gp->lg_provider); if (pp == NULL) @@ -274,7 +277,9 @@ show_config(struct ggeom *gp, int verbose) printf("queue_count: %s\n", get_conf(gp, "queue_count")); printf(" queue_size: %s\n", get_conf(gp, "queue_size")); printf(" references: %s\n", get_conf(gp, "ref")); - printf(" mediasize: %jd\n", pp->lg_mediasize); + humanize_number(buf, sizeof(buf), (int64_t)pp->lg_mediasize, "", + HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + printf(" mediasize: %jd (%s)\n", (intmax_t)pp->lg_mediasize, buf); printf(" sectorsize: %u\n", pp->lg_sectorsize); printf(" mode: %s\n", pp->lg_mode); printf("\n"); -- cgit v1.1