]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - teeboth
adapter: random changes
[packages/rpm-build-tools.git] / teeboth
diff --git a/teeboth b/teeboth
index 6c0f53372ba323045678637f2917677ade8bad6f..459e0c888e4b1b563bfe10a844fd72ed4bad723a 100755 (executable)
--- a/teeboth
+++ b/teeboth
@@ -16,6 +16,7 @@ open my $fout, ">>", $out or die "Can't write to $out: $!" if $out;
 my $select = IO::Select->new();
 my $alive = 1;
 my $pid;
+my $interactive = -t STDOUT;
 
 my $code;
 sub sigchld
@@ -52,9 +53,9 @@ sethandle( \*child_err );
 
 while ( $alive ) {
        foreach my $h ( $select->can_read() ) {
-               sysread $h, $_, 1024;
+               sysread $h, $_, 102400;
                print $fout $_ if $fout;
-               if ( $h == \*child_err ) {
+               if ( $interactive && $h == \*child_err ) {
                        print "\033[31m$_\033[0m";
                } else {
                        print $_;
This page took 0.040113 seconds and 4 git commands to generate.