summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-08-12 10:23:49 +0000
committerdg <dg@FreeBSD.org>1994-08-12 10:23:49 +0000
commit1e4a2dfbefadd601b37994f9aed9f2bc2c801183 (patch)
treed29865af04fe6adc01d9866159a2ed7dfb1ab4a0 /bin
parentf8355e406b52134daa409524f1a63761210b3718 (diff)
downloadFreeBSD-src-1e4a2dfbefadd601b37994f9aed9f2bc2c801183.zip
FreeBSD-src-1e4a2dfbefadd601b37994f9aed9f2bc2c801183.tar.gz
The last commit was bogus...the putenv doesn't affect the parent process,
so the BLOCKSIZE doesn't need to be preserved. Also initialized the flags variables, and used 1k instead of 1024 for BLOCKSIZE.
Diffstat (limited to 'bin')
-rw-r--r--bin/df/df.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/bin/df/df.c b/bin/df/df.c
index 24a5d26..ec10cc9 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -107,7 +107,7 @@ void prtstat __P((struct statfs *, int));
void ufs_df __P((char *, int));
void usage __P((void));
-int iflag, nflag, tflag, kflag;
+int iflag, nflag, tflag;
struct ufs_args mdev;
int
@@ -121,7 +121,7 @@ main(argc, argv)
int ch, err, i, maxwidth, width;
char *mntpt;
- iflag = nflag = tflag = kflag = 0;
+ iflag = nflag = tflag = 0;
while ((ch = getopt(argc, argv, "iknt:")) != EOF)
switch (ch) {
@@ -129,7 +129,7 @@ main(argc, argv)
iflag = 1;
break;
case 'k':
- kflag = 1;
+ putenv("BLOCKSIZE=1k");
break;
case 'n':
nflag = 1;
@@ -307,18 +307,11 @@ prtstat(sfsp, maxwidth)
static int headerlen, timesthrough;
static char *header;
long used, availblks, inodes;
- char *oldbsize = NULL;
if (maxwidth < 11)
maxwidth = 11;
if (++timesthrough == 1) {
- if (kflag) {
- oldbsize = getenv("BLOCKSIZE");
- putenv("BLOCKSIZE=1k");
- }
header = getbsize(&headerlen, &blocksize);
- if (oldbsize)
- putenv(oldbsize);
(void)printf("%-*.*s %s Used Avail Capacity",
maxwidth, maxwidth, "Filesystem", header);
if (iflag)
OpenPOWER on IntegriCloud