summaryrefslogtreecommitdiffstats
path: root/usr.bin/du
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-08-12 10:19:05 +0000
committerdg <dg@FreeBSD.org>1994-08-12 10:19:05 +0000
commitf8355e406b52134daa409524f1a63761210b3718 (patch)
treea9a0d8b1ffce7f8022f3062b78b1c739b805a216 /usr.bin/du
parent679aa902928d20d002ff66fbba075b6fcae551c4 (diff)
downloadFreeBSD-src-f8355e406b52134daa409524f1a63761210b3718.zip
FreeBSD-src-f8355e406b52134daa409524f1a63761210b3718.tar.gz
The last commit was bogus...the putenv doesn't affect the parent process,
so the BLOCKSIZE doesn't need to be preserved.
Diffstat (limited to 'usr.bin/du')
-rw-r--r--usr.bin/du/du.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index 2cae7e8..49b5f9b 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -66,13 +66,12 @@ main(argc, argv)
FTS *fts;
FTSENT *p;
long blocksize;
- char *oldbsize = NULL;
int ftsoptions, listdirs, listfiles;
- int Hflag, Lflag, Pflag, aflag, ch, notused, rval, sflag, kflag;
+ int Hflag, Lflag, Pflag, aflag, ch, notused, rval, sflag;
char **save;
save = argv;
- Hflag = Lflag = Pflag = aflag = sflag = kflag = 0;
+ Hflag = Lflag = Pflag = aflag = sflag = 0;
ftsoptions = FTS_PHYSICAL;
while ((ch = getopt(argc, argv, "HLPaksx")) != EOF)
switch (ch) {
@@ -92,7 +91,7 @@ main(argc, argv)
aflag = 1;
break;
case 'k':
- kflag = 1;
+ putenv("BLOCKSIZE=1024");
break;
case 's':
sflag = 1;
@@ -143,13 +142,7 @@ main(argc, argv)
argv[1] = NULL;
}
- if (kflag) {
- oldbsize = getenv("BLOCKSIZE");
- putenv("BLOCKSIZE=1k");
- }
(void)getbsize(&notused, &blocksize);
- if (oldbsize)
- putenv(oldbsize);
blocksize /= 512;
if ((fts = fts_open(argv, ftsoptions, NULL)) == NULL)
OpenPOWER on IntegriCloud