diff options
author | Zach Koopmans <zkoopmans@google.com> | 2021-06-22 15:50:41 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-06-22 15:53:32 -0700 |
commit | e1dc1c78e7a523fc64ca28bed60a9a40ea1de46a (patch) | |
tree | a8679f27d3a333ed79f5620ba8109985cbcdcf4e /pkg/sentry/fsimpl/host/tty.go | |
parent | 01bcd55c3ad3b6c3bc0179a13e5f0045fa3707b7 (diff) |
[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
Diffstat (limited to 'pkg/sentry/fsimpl/host/tty.go')
-rw-r--r-- | pkg/sentry/fsimpl/host/tty.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/sentry/fsimpl/host/tty.go b/pkg/sentry/fsimpl/host/tty.go index 0f9e20a84..2cf360065 100644 --- a/pkg/sentry/fsimpl/host/tty.go +++ b/pkg/sentry/fsimpl/host/tty.go @@ -17,6 +17,7 @@ package host import ( "gvisor.dev/gvisor/pkg/abi/linux" "gvisor.dev/gvisor/pkg/context" + "gvisor.dev/gvisor/pkg/errors/linuxerr" "gvisor.dev/gvisor/pkg/marshal/primitive" "gvisor.dev/gvisor/pkg/sentry/arch" "gvisor.dev/gvisor/pkg/sentry/kernel" @@ -211,7 +212,7 @@ func (t *TTYFileDescription) Ioctl(ctx context.Context, io usermem.IO, args arch if err := t.checkChange(ctx, linux.SIGTTOU); err != nil { // drivers/tty/tty_io.c:tiocspgrp() converts -EIO from tty_check_change() // to -ENOTTY. - if err == syserror.EIO { + if linuxerr.Equals(linuxerr.EIO, err) { return 0, syserror.ENOTTY } return 0, err |