]> git.pld-linux.org Git - packages/rpm-build-tools.git/blobdiff - teeboth
Release 2 (by relup.sh)
[packages/rpm-build-tools.git] / teeboth
diff --git a/teeboth b/teeboth
index d5983527f35b78137fffde4b7dca69e1687bd5de..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
@@ -31,8 +32,7 @@ sub sigchld
 }
 $SIG{CHLD} = \&sigchld;
 
-$pid = open3( \*child_in, \*child_out, \*child_err, @ARGV );
-close child_in;
+$pid = open3( "<&STDIN",  \*child_out, \*child_err, @ARGV );
 
 sub sethandle
 {
@@ -53,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.046069 seconds and 4 git commands to generate.