Skip to content

Commit 3d97a24

Browse files
committed
internal/socket: check for EWOULDBLOCK on all platforms
Don't make the check for EWOULDBLOCK zos-specific. Most platforms define EAGAIN and EWOULDBLOCK with the same underlying value. Thus, the additional check will be a no-op on them. On platforms where EAGAIN and EWOULDBLOCK have different underlying values, we probably want to check both as well. As pointed out by Michael Munday in CL 264028. Change-Id: Id3404fc4440c66a3484975b4c94b4ebb788b80a1 Reviewed-on: https://go-review.googlesource.com/c/net/+/295569 Trust: Tobias Klauser <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 9060382 commit 3d97a24

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

internal/socket/rawconn_msg.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package socket
99

1010
import (
1111
"os"
12-
"runtime"
1312
"syscall"
1413
)
1514

@@ -26,7 +25,7 @@ func (c *Conn) recvMsg(m *Message, flags int) error {
2625
var n int
2726
fn := func(s uintptr) bool {
2827
n, operr = recvmsg(s, &h, flags)
29-
if operr == syscall.EAGAIN || (runtime.GOOS == "zos" && operr == syscall.EWOULDBLOCK) {
28+
if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK {
3029
return false
3130
}
3231
return true
@@ -63,7 +62,7 @@ func (c *Conn) sendMsg(m *Message, flags int) error {
6362
var n int
6463
fn := func(s uintptr) bool {
6564
n, operr = sendmsg(s, &h, flags)
66-
if operr == syscall.EAGAIN || (runtime.GOOS == "zos" && operr == syscall.EWOULDBLOCK) {
65+
if operr == syscall.EAGAIN || operr == syscall.EWOULDBLOCK {
6766
return false
6867
}
6968
return true

0 commit comments

Comments
 (0)