diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-08-08 00:10:23 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2026-08-08 00:10:46 +0000 |
| commit | fd79bf63442eefd2c3bfb695a377dbd705f5cc6d (patch) | |
| tree | 543a0424c357c7d08cd72f3b186ebf4fab852dfd /usr.bin/du/du.c | |
| parent | 4c4bad4421fb1a300178767f71215cc5f5e0bfb6 (diff) | |
du: Print progress information to stderr
* On SIGINFO, print the current path to stderr rather than stdout.
* Do so immediately, instead of the next time we finish a directory.
* Document this behavior in the manual page.
PR: 296861
MFC after: 1 week
Fixes: d1588599c024 ("Report the next directory being scanned ...")
Reviewed by: wollman
Differential Revision: https://reviews.freebsd.org/D58702
Diffstat (limited to 'usr.bin/du/du.c')
| -rw-r--r-- | usr.bin/du/du.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index bf138b1b5e36..47ed3c840d5a 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -270,6 +270,10 @@ main(int argc, char *argv[]) xo_open_container("disk-usage-information"); xo_open_list("paths"); for (errno = 0; (p = fts_read(fts)) != NULL; errno = 0) { + if (info) { + info = 0; + (void)fprintf(stderr, "\t%s\n", p->fts_path); + } switch (p->fts_info) { case FTS_D: /* Ignore. */ if (ignorep(p)) @@ -284,10 +288,6 @@ main(int argc, char *argv[]) if (p->fts_level <= depth && check_threshold(p)) print_file_size(p); - if (info) { - info = 0; - (void)printf("\t%s\n", p->fts_path); - } break; case FTS_DC: /* Ignore. */ break; |
