summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjanzen <pjanzen@openbsd.org>2001-05-02 23:26:52 +0000
committerpjanzen <pjanzen@openbsd.org>2001-05-02 23:26:52 +0000
commitdc70f64308eb51374a431e043de00176d95c54d7 (patch)
tree1bb1ceb5d01603204e6233fbd3c01fe4d5494e88
parentSync with NetBSD. Notable changes: (diff)
downloadwireguard-openbsd-dc70f64308eb51374a431e043de00176d95c54d7.tar.xz
wireguard-openbsd-dc70f64308eb51374a431e043de00176d95c54d7.zip
-h overrides BLOCKSIZE; matt@anzen.com
-rw-r--r--usr.bin/du/du.16
-rw-r--r--usr.bin/du/du.c11
2 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1
index 77bb3afc20c..277a512f7a6 100644
--- a/usr.bin/du/du.1
+++ b/usr.bin/du/du.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: du.1,v 1.15 2001/05/01 17:58:02 aaron Exp $
+.\" $OpenBSD: du.1,v 1.16 2001/05/02 23:26:52 pjanzen Exp $
.\" $NetBSD: du.1,v 1.6 1996/10/18 07:20:31 thorpej Exp $
.\"
.\" Copyright (c) 1990, 1993
@@ -132,7 +132,9 @@ execution.
.It Ev BLOCKSIZE
Block counts will be displayed in units of this size block, unless the
.Fl k
-option is also specified.
+or
+.Fl h
+option is specified.
.El
.Sh SEE ALSO
.Xr df 1 ,
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index f26e7cf365d..9fb19af78f3 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: du.c,v 1.7 2001/02/23 19:14:21 pjanzen Exp $ */
+/* $OpenBSD: du.c,v 1.8 2001/05/02 23:26:53 pjanzen Exp $ */
/* $NetBSD: du.c,v 1.11 1996/10/18 07:20:35 thorpej Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)du.c 8.5 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: du.c,v 1.7 2001/02/23 19:14:21 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: du.c,v 1.8 2001/05/02 23:26:53 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -110,7 +110,6 @@ main(argc, argv)
hflag = 1;
break;
case 'k':
- blocksize = 1024;
kflag = 1;
break;
case 's':
@@ -164,7 +163,11 @@ main(argc, argv)
argv[1] = NULL;
}
- if (!kflag || hflag)
+ if (hflag)
+ blocksize = 512;
+ else if (kflag)
+ blocksize = 1024;
+ else
(void)getbsize(&notused, &blocksize);
blocksize /= 512;