summaryrefslogtreecommitdiffhomepage
path: root/pkg/syserr
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/syserr')
-rw-r--r--pkg/syserr/BUILD1
-rw-r--r--pkg/syserr/syserr.go3
2 files changed, 3 insertions, 1 deletions
diff --git a/pkg/syserr/BUILD b/pkg/syserr/BUILD
index 7b3160309..5205fa7e4 100644
--- a/pkg/syserr/BUILD
+++ b/pkg/syserr/BUILD
@@ -12,6 +12,7 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/abi/linux/errno",
+ "//pkg/errors/linuxerr",
"//pkg/syserror",
"//pkg/tcpip",
"@org_golang_x_sys//unix:go_default_library",
diff --git a/pkg/syserr/syserr.go b/pkg/syserr/syserr.go
index fb77ac8bd..7d0a5125b 100644
--- a/pkg/syserr/syserr.go
+++ b/pkg/syserr/syserr.go
@@ -22,6 +22,7 @@ import (
"golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/abi/linux/errno"
+ "gvisor.dev/gvisor/pkg/errors/linuxerr"
"gvisor.dev/gvisor/pkg/syserror"
)
@@ -54,7 +55,7 @@ func New(message string, linuxTranslation errno.Errno) *Error {
// enables proper blocking semantics. This should temporary address the
// class of blocking bugs that keep popping up with the current state of
// the error space.
- if e == syserror.EWOULDBLOCK {
+ if err.errno == linuxerr.EWOULDBLOCK.Errno() {
e = syserror.ErrWouldBlock
}
linuxBackwardsTranslations[err.errno] = linuxBackwardsTranslation{err: e, ok: true}