diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-08-14 00:21:23 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-08-14 00:21:23 +0000 |
commit | 3b15f3497631993c9a2aca40abd691993c0acb79 (patch) | |
tree | fd4e3a66fa5471772934b2f923c0511656b011eb /pkg/safecopy | |
parent | 04387bed63970c84d62156a9c1b3c6112b9aca21 (diff) | |
parent | ce58d71fd526587c0ed5e898e3a680c30c02c6d2 (diff) |
Merge release-20210806.0-29-gce58d71fd (automated)
Diffstat (limited to 'pkg/safecopy')
-rw-r--r-- | pkg/safecopy/safecopy.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/safecopy/safecopy.go b/pkg/safecopy/safecopy.go index df63dd5f1..5e6f903ff 100644 --- a/pkg/safecopy/safecopy.go +++ b/pkg/safecopy/safecopy.go @@ -21,7 +21,8 @@ import ( "runtime" "golang.org/x/sys/unix" - "gvisor.dev/gvisor/pkg/syserror" + "gvisor.dev/gvisor/pkg/errors" + "gvisor.dev/gvisor/pkg/errors/linuxerr" ) // SegvError is returned when a safecopy function receives SIGSEGV. @@ -137,12 +138,12 @@ func init() { if err := ReplaceSignalHandler(unix.SIGBUS, addrOfSignalHandler(), &savedSigBusHandler); err != nil { panic(fmt.Sprintf("Unable to set handler for SIGBUS: %v", err)) } - syserror.AddErrorUnwrapper(func(e error) (unix.Errno, bool) { + linuxerr.AddErrorUnwrapper(func(e error) (*errors.Error, bool) { switch e.(type) { case SegvError, BusError, AlignmentError: - return unix.EFAULT, true + return linuxerr.EFAULT, true default: - return 0, false + return nil, false } }) } |