Date: Tue, 18 Oct 2011 13:10:46 +0000 (UTC) From: Dag-Erling Smorgrav <des@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r226509 - head/bin/ls Message-ID: <201110181310.p9IDAk0X074948@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: des Date: Tue Oct 18 13:10:46 2011 New Revision: 226509 URL: http://svn.freebsd.org/changeset/base/226509 Log: 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 Modified: head/bin/ls/ls.c Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Tue Oct 18 12:13:20 2011 (r226508) +++ head/bin/ls/ls.c Tue Oct 18 13:10:46 2011 (r226509) @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)ls.c 8.5 (Be #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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110181310.p9IDAk0X074948>