unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [RFC][PATCH] ProcessPipe.pm: Use read not sysread
@ 2018-07-30  5:04 Eric W. Biederman
  2018-07-30  5:46 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Eric W. Biederman @ 2018-07-30  5:04 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta


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>
---

Am I missing something or was this a fundamental bug from the beginning?

 lib/PublicInbox/ProcessPipe.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/ProcessPipe.pm b/lib/PublicInbox/ProcessPipe.pm
index 7bb6ddee40b1..2769e064ca21 100644
--- a/lib/PublicInbox/ProcessPipe.pm
+++ b/lib/PublicInbox/ProcessPipe.pm
@@ -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}) }
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-30 11:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-30  5:04 [RFC][PATCH] ProcessPipe.pm: Use read not sysread Eric W. Biederman
2018-07-30  5:46 ` Eric Wong
2018-07-30 11:57   ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).