]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
du: fflush after outputting a line
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 Mar 2026 03:07:52 +0000 (19:07 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 Mar 2026 03:13:42 +0000 (19:13 -0800)
* src/du.c (print_size): Resurrect the fflush call, since there
can be significant delay between output lines.

src/du.c

index a41ece904ab2753e73bb809719b8dad533cdbead..bff1b6672ed7feb426d08feb89bd737094e762a8 100644 (file)
--- a/src/du.c
+++ b/src/du.c
@@ -467,7 +467,7 @@ print_size (const struct duinfo *pdui, char const *string)
   putchar ('\t');
   fputs (string, stdout);
   putchar (opt_nul_terminate_output ? '\0' : '\n');
-  if (ferror (stdout))
+  if (fflush (stdout) < 0)
     write_error ();
 }