Skip to content
Permalink
Browse files
mtr: force-flush stderr and stdout
prevents buffering in cases like

  ./mtr | tee log
  • Loading branch information
vuvova committed Feb 24, 2018
1 parent a04e4f5 commit e49c1d1
Showing 1 changed file with 2 additions and 0 deletions.
@@ -1,4 +1,5 @@
package My::Tee;
use IO::Handle;

# see PerlIO::via

@@ -16,6 +17,7 @@ sub WRITE
{
my ($obj, $buf, $fh) = @_;
print $fh $buf;
$fh->flush;
print $copyfh $buf;
return length($buf);
}

0 comments on commit e49c1d1

Please sign in to comment.