On 05/12/2019 05:18, Mike Zelik wrote:
* src/tee.c: remove setvbuf(...) unbuffering
(Forcing a flush after every write is needlessly inefficient)
---
  src/tee.c | 2 --
  1 file changed, 2 deletions(-)

diff --git a/src/tee.c b/src/tee.c
index d3aecc7b1..ec66a793e 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -205,7 +205,6 @@ tee_files (int nfiles, char **files)
    files--;
    descriptors[0] = stdout;
    files[0] = bad_cast (_("standard output"));
-  setvbuf (stdout, NULL, _IONBF, 0);
    n_outputs++;

    for (i = 1; i <= nfiles; i++)
@@ -221,7 +220,6 @@ tee_files (int nfiles, char **files)
          }
        else
          {
-          setvbuf (descriptors[i], NULL, _IONBF, 0);
            n_outputs++;
          }
      }


Well the idea here is that tee is not generating/transforming data,
so should propagate the data as soon as it gets it.

As a side note, somewhat related to this, I've a local patch
to change from using stdio streams to using files.
(tee was converted to streams initially to support a compression option I 
think).

cheers,
Pádraig

Reply via email to