]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ProcessPipe.pm: Use read not sysread
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 30 Jul 2018 05:04:45 +0000 (00:04 -0500)
committerEric Wong <e@80x24.org>
Mon, 30 Jul 2018 08:06:42 +0000 (08:06 +0000)
While playing with git fast export I discovered that mixing <> and
read would give inconsistent results.  I tracked the issue down to
using sysread in ProcessPipe instead of plain read.

If it is desirable to use readline I can't see how using sysread
can work as readline to be efficient needs to use buffered I/O.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
lib/PublicInbox/ProcessPipe.pm

index 7bb6ddee40b1728e8a082b2a48353522cd03108a..2769e064ca21d1651fbace905a167ba17922802b 100644 (file)
@@ -11,7 +11,7 @@ sub TIEHANDLE {
        bless { pid => $pid, fh => $fh }, $class;
 }
 
-sub READ { sysread($_[0]->{fh}, $_[1], $_[2], $_[3] || 0) }
+sub READ { read($_[0]->{fh}, $_[1], $_[2], $_[3] || 0) }
 
 sub READLINE { readline($_[0]->{fh}) }