Commit Diff
- Commit:
33d1516211d64cc5f3039898d3d635b29fbe6bf6
- From:
- Jonathan Rudenberg <jonathan@titanous.com>
- Date:
- Message:
- 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 <jonathan@titanous.com>
- Actions:
- Patch | Tree
--- 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 }