git: 5ea5220d1788 - stable/14 - du: Fix threshold on non-directory files
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 01 Jun 2025 19:54:09 UTC
The branch stable/14 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=5ea5220d17881015df67e4f182e337bd269b9f34
commit 5ea5220d17881015df67e4f182e337bd269b9f34
Author: Michal Scigocki <michal.os@hotmail.com>
AuthorDate: 2025-04-07 11:14:44 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-06-01 19:53:29 +0000
du: Fix threshold on non-directory files
PR: 265200
Reviewed by: markj
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/1648
(cherry picked from commit 0ae2b9e866d3aea1e9141841488561f12603f879)
---
usr.bin/du/du.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
index ead3e952ce0f..90b95b3d86e9 100644
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -320,7 +320,9 @@ main(int argc, char *argv[])
howmany(p->fts_statp->st_size, cblocksize) :
howmany(p->fts_statp->st_blocks, cblocksize);
- if (aflag || p->fts_level == 0) {
+ if ((aflag || p->fts_level == 0) && threshold <=
+ threshold_sign * howmany(curblocks * cblocksize,
+ blocksize)) {
if (hflag > 0) {
prthumanval(curblocks);
(void)printf("\t%s\n", p->fts_path);