1
0
mirror of https://github.com/golang/go synced 2024-11-12 04:30:22 -07:00

net: don't return io.EOF from zero byte reads on Plan 9

Updates #15735.
Fixes #15741.

Change-Id: Ic4ad7e948e8c3ab5feffef89d7a37417f82722a1
Reviewed-on: https://go-review.googlesource.com/23199
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Mikio Hara 2016-05-19 12:04:10 +09:00 committed by Brad Fitzpatrick
parent 5bcdd63933
commit 8d428ed218

View File

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