commit 4a062b38f25cc43661f462ffffeb99456b98a64e from: Jonathan Rudenberg via: Jeff Lindsay date: Wed Jun 21 00:56:40 2017 UTC Fix EOF indication from Readdir EOF is indicated by a zero-length result with no error, so ensure that io.EOF does not ever get returned by Readdir.Read. Signed-off-by: Jonathan Rudenberg commit - f2ad3c4d4632f2eaecafaf60f3b0e3358209072d commit + 4a062b38f25cc43661f462ffffeb99456b98a64e blob - 1f0419c579d73a6f4af29792367ac0848ee3c57d blob + 23756c2d9ecadb41aeb0af2d621c1af389682ea4 --- readdir.go +++ readdir.go @@ -82,9 +82,9 @@ func (rd *Readdir) Read(ctx context.Context, p []byte, } done: - if err == io.EOF && len(p) > 0 { - // Don't let io.EOF escape if we've written to p. 9p doesn't handle - // this like Go. + if err == io.EOF { + // Don't let io.EOF escape. EOF is indicated by a zero-length result + // with no error. err = nil }