diff options
author | des <des@FreeBSD.org> | 2011-10-18 13:10:46 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2011-10-18 13:10:46 +0000 |
commit | 9ce09549afb47ae78fcbd7f71c5374ec7a555f39 (patch) | |
tree | ae1ec03cf3c9c59aba44f0d560b2b754e7769cec /bin/ls | |
parent | 5adf6f1dc4439ae711f67ba48a6087cf07c6b34d (diff) | |
download | FreeBSD-src-9ce09549afb47ae78fcbd7f71c5374ec7a555f39.zip FreeBSD-src-9ce09549afb47ae78fcbd7f71c5374ec7a555f39.tar.gz |
When calculating the width of the blocksize column, ls(1) used 512-byte
units (as returned by stat(2)) instead of BLOCKSIZE units.
Submitted by: Paul Schenkeveld
MFC after: 3 weeks
Diffstat (limited to 'bin/ls')
-rw-r--r-- | bin/ls/ls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 569f3d9..29471a6 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)ls.c 8.5 (Berkeley) 4/2/94"; #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#include <sys/types.h> +#include <sys/param.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/mac.h> @@ -835,7 +835,7 @@ label_out: d.maxlen = maxlen; if (needstats) { d.btotal = btotal; - d.s_block = snprintf(NULL, 0, "%lu", maxblock); + d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; |