Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156472383
D41103.id124890.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D41103.id124890.diff
View Options
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c
--- a/usr.bin/du/du.c
+++ b/usr.bin/du/du.c
@@ -322,7 +322,9 @@
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);
diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh
--- a/usr.bin/du/tests/du_test.sh
+++ b/usr.bin/du/tests/du_test.sh
@@ -177,6 +177,23 @@
atf_check -o inline:'1.5M\tA\n1.6M\tB\n' du -A --si A B
}
+atf_test_case a_t_flags
+a_t_flags_head()
+{
+ atf_set "descr" "Verify the use of -a and -t together"
+}
+
+a_t_flags_body()
+{
+ mkdir -p testdir/nested
+ cd testdir
+ atf_check truncate -s 2M nested/A
+ atf_check truncate -s 1M nested/B
+
+ atf_check -o inline:'2048\tnested/A\n3073\tnested/\n' \
+ du -aAt 1536K nested/
+}
+
atf_init_test_cases()
{
atf_add_test_case A_flag
@@ -187,4 +204,5 @@
atf_add_test_case k_flag
atf_add_test_case m_flag
atf_add_test_case si_flag
+ atf_add_test_case a_t_flags
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 14, 10:08 PM (19 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33063797
Default Alt Text
D41103.id124890.diff (1 KB)
Attached To
Mode
D41103: du: exclude non-directories under -t threshold
Attached
Detach File
Event Timeline
Log In to Comment