Page MenuHomeFreeBSD

D41103.id124890.diff
No OneTemporary

D41103.id124890.diff

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

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)

Event Timeline