Skip to content

Commit

Permalink
net: don't return io.EOF from zero byte reads on Plan 9
Browse files Browse the repository at this point in the history
Updates #15735.
Fixes #15741.

Change-Id: Ic4ad7e948e8c3ab5feffef89d7a37417f82722a1
Reviewed-on: https://go-review.googlesource.com/23199
Run-TryBot: Mikio Hara <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
cixtor authored and bradfitz committed May 19, 2016
1 parent 5bcdd63 commit 8d428ed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/net/fd_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func (fd *netFD) Read(b []byte) (n int, err error) {
return 0, err
}
defer fd.readUnlock()
if len(b) == 0 {
return 0, nil
}
n, err = fd.data.Read(b)
if isHangup(err) {
err = io.EOF
Expand Down

0 comments on commit 8d428ed

Please sign in to comment.