diff options
author | pjd <pjd@FreeBSD.org> | 2004-05-26 11:08:35 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-05-26 11:08:35 +0000 |
commit | 069fe3e9ef2d553d5d3595fea937d5aa4fbdcf5d (patch) | |
tree | 15c707df968a1f206112aac7b7712e84b540fe3b /sbin/geom/core | |
parent | 8be6dace2bc14f1cd052e5bf5a868d62885110c1 (diff) | |
download | FreeBSD-src-069fe3e9ef2d553d5d3595fea937d5aa4fbdcf5d.zip FreeBSD-src-069fe3e9ef2d553d5d3595fea937d5aa4fbdcf5d.tar.gz |
Print provider's size in human-readable form as well.
Diffstat (limited to 'sbin/geom/core')
-rw-r--r-- | sbin/geom/core/Makefile | 4 | ||||
-rw-r--r-- | sbin/geom/core/geom.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sbin/geom/core/Makefile b/sbin/geom/core/Makefile index d17d51a..2790e04 100644 --- a/sbin/geom/core/Makefile +++ b/sbin/geom/core/Makefile @@ -9,7 +9,7 @@ SRCS= geom.c subr.c CFLAGS+= -DCLASSDIR=\"${CLASSDIR}\" CFLAGS+= -I${.CURDIR}/../../../sys -I${.CURDIR} -I${.CURDIR}/.. -DPADD= ${LIBGEOM} ${LIBSBUF} ${LIBBSDXML} -LDADD= -lgeom -lsbuf -lbsdxml +DPADD= ${LIBBSDXML} ${LIBGEOM} ${LIBSBUF} ${LIBUTIL} +LDADD= -lbsdxml -lgeom -lsbuf -lutil .include <bsd.prog.mk> diff --git a/sbin/geom/core/geom.c b/sbin/geom/core/geom.c index 963b1bc..4a2d1cc 100644 --- a/sbin/geom/core/geom.c +++ b/sbin/geom/core/geom.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include <string.h> #include <unistd.h> #include <libgen.h> +#include <libutil.h> #include <inttypes.h> #include <dlfcn.h> #include <assert.h> @@ -586,10 +587,13 @@ static void show_one(struct gprovider *pp) { struct gconfig *conf; + char buf[5]; printf(" NAME: %s\n", pp->lg_name); printf(" geom name: %s\n", pp->lg_geom->lg_name); - printf(" mediasize: %jd\n", (intmax_t)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); LIST_FOREACH(conf, &pp->lg_config, lg_config) { |