coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tee: let the terminal/OS buffer IO as needed


From: Pádraig Brady
Subject: Re: [PATCH] tee: let the terminal/OS buffer IO as needed
Date: Thu, 5 Dec 2019 16:09:45 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Thunderbird/70.0

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

[Prev in Thread] Current Thread [Next in Thread]