summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket/unix/io.go
diff options
context:
space:
mode:
authorIan Gudger <igudger@google.com>2018-10-24 11:04:11 -0700
committerShentubot <shentubot@google.com>2018-10-24 11:05:08 -0700
commit425dccdd7ed035a671aaf8da1982f7b029365d66 (patch)
tree542f87477c0928dae95d035e2551eedb6606de72 /pkg/sentry/socket/unix/io.go
parentc99006a240be6381f5ac6c6c7c70839df84e1c1d (diff)
Convert Unix transport to syserr
Previously this code used the tcpip error space. Since it is no longer part of netstack, it can use the sentry's error space (except for a few cases where there is still some shared code. This reduces the number of error space conversions required for hot Unix socket operations. PiperOrigin-RevId: 218541611 Change-Id: I3d13047006a8245b5dfda73364d37b8a453784bb
Diffstat (limited to 'pkg/sentry/socket/unix/io.go')
-rw-r--r--pkg/sentry/socket/unix/io.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkg/sentry/socket/unix/io.go b/pkg/sentry/socket/unix/io.go
index 7d6434696..7d80e4393 100644
--- a/pkg/sentry/socket/unix/io.go
+++ b/pkg/sentry/socket/unix/io.go
@@ -17,7 +17,6 @@ package unix
import (
"gvisor.googlesource.com/gvisor/pkg/sentry/safemem"
"gvisor.googlesource.com/gvisor/pkg/sentry/socket/unix/transport"
- "gvisor.googlesource.com/gvisor/pkg/syserr"
"gvisor.googlesource.com/gvisor/pkg/tcpip"
)
@@ -40,7 +39,7 @@ func (w *EndpointWriter) WriteFromBlocks(srcs safemem.BlockSeq) (uint64, error)
return safemem.FromVecWriterFunc{func(bufs [][]byte) (int64, error) {
n, err := w.Endpoint.SendMsg(bufs, w.Control, w.To)
if err != nil {
- return int64(n), syserr.TranslateNetstackError(err).ToError()
+ return int64(n), err.ToError()
}
return int64(n), nil
}}.WriteFromBlocks(srcs)
@@ -82,7 +81,7 @@ func (r *EndpointReader) ReadToBlocks(dsts safemem.BlockSeq) (uint64, error) {
r.Control = c
r.MsgSize = ms
if err != nil {
- return int64(n), syserr.TranslateNetstackError(err).ToError()
+ return int64(n), err.ToError()
}
return int64(n), nil
}}.ReadToBlocks(dsts)