mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
[syserror] Add conversions to linuxerr with temporary Equals method.
Add Equals method to compare syserror and unix.Errno errors to linuxerr errors. This will facilitate removal of syserror definitions in a followup, and finding needed conversions from unix.Errno to linuxerr. PiperOrigin-RevId: 380909667
This commit is contained in:
committed by
gVisor bot
parent
01bcd55c3a
commit
e1dc1c78e7
@@ -118,6 +118,7 @@ go_test(
|
||||
deps = [
|
||||
"//pkg/abi/linux",
|
||||
"//pkg/context",
|
||||
"//pkg/errors/linuxerr",
|
||||
"//pkg/fspath",
|
||||
"//pkg/sentry/contexttest",
|
||||
"//pkg/sentry/fs/lock",
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
|
||||
"gvisor.dev/gvisor/pkg/abi/linux"
|
||||
"gvisor.dev/gvisor/pkg/context"
|
||||
"gvisor.dev/gvisor/pkg/errors/linuxerr"
|
||||
"gvisor.dev/gvisor/pkg/fspath"
|
||||
"gvisor.dev/gvisor/pkg/sentry/contexttest"
|
||||
"gvisor.dev/gvisor/pkg/sentry/kernel/auth"
|
||||
@@ -114,7 +115,7 @@ func TestNonblockingWriteError(t *testing.T) {
|
||||
}
|
||||
openOpts := vfs.OpenOptions{Flags: linux.O_WRONLY | linux.O_NONBLOCK}
|
||||
_, err := vfsObj.OpenAt(ctx, creds, &pop, &openOpts)
|
||||
if err != syserror.ENXIO {
|
||||
if !linuxerr.Equals(linuxerr.ENXIO, err) {
|
||||
t.Fatalf("expected ENXIO, but got error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user