From 8d428ed218d2b65dbb4abbd9be870c95439a2b14 Mon Sep 17 00:00:00 2001 From: Mikio Hara Date: Thu, 19 May 2016 12:04:10 +0900 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/net/fd_plan9.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/net/fd_plan9.go b/src/net/fd_plan9.go index 8e272b1eb85e53..7533232dc9b5eb 100644 --- a/src/net/fd_plan9.go +++ b/src/net/fd_plan9.go @@ -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