From f66e339c33c73f27e28d8a2d384261995a69c425 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Fri, 12 Aug 1994 02:02:22 +0000 Subject: [PATCH] Implement -k flag. --- usr.sbin/swapinfo/swapinfo.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr.sbin/swapinfo/swapinfo.c b/usr.sbin/swapinfo/swapinfo.c index f17489e2a0c..bf1a3131e22 100644 --- a/usr.sbin/swapinfo/swapinfo.c +++ b/usr.sbin/swapinfo/swapinfo.c @@ -51,6 +51,7 @@ char **argv; static long blocksize; static int headerlen; static char *header; + char *oldbsize = NULL; char **save; kvm_t *kd; @@ -174,7 +175,13 @@ char **argv; swapmap = head.rl_next; } + if (kflag) { + oldbsize = getenv("BLOCKSIZE"); + putenv("BLOCKSIZE=1k"); + } header = getbsize(&headerlen, &blocksize); + if (oldbsize) + putenv(oldbsize); printf ("%-10s %10s %10s %10s %10s\n", "Device", header, "Used", "Available", "Capacity"); for (total_avail = total_partitions = i = 0; i < nswdev; i++) {