summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/loader/loader.go
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2021-08-12 15:16:45 -0700
committergVisor bot <gvisor-bot@google.com>2021-08-12 15:19:12 -0700
commit02370bbd315d7e7c2783d7001d014870cf1ef534 (patch)
tree4e5c4cddf1ef6a49d449e7a871e0f54fd6d30201 /pkg/sentry/loader/loader.go
parent5f132ae1f889829e57ef6b2117342247b0f75b3a (diff)
[syserror] Convert remaining syserror definitions to linuxerr.
Convert remaining public errors (e.g. EINTR) from syserror to linuxerr. PiperOrigin-RevId: 390471763
Diffstat (limited to 'pkg/sentry/loader/loader.go')
-rw-r--r--pkg/sentry/loader/loader.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/pkg/sentry/loader/loader.go b/pkg/sentry/loader/loader.go
index 86d0c54cd..6a356779c 100644
--- a/pkg/sentry/loader/loader.go
+++ b/pkg/sentry/loader/loader.go
@@ -35,7 +35,6 @@ import (
"gvisor.dev/gvisor/pkg/sentry/mm"
"gvisor.dev/gvisor/pkg/sentry/vfs"
"gvisor.dev/gvisor/pkg/syserr"
- "gvisor.dev/gvisor/pkg/syserror"
"gvisor.dev/gvisor/pkg/usermem"
)
@@ -91,7 +90,7 @@ type LoadArgs struct {
func openPath(ctx context.Context, args LoadArgs) (fsbridge.File, error) {
if args.Filename == "" {
ctx.Infof("cannot open empty name")
- return nil, syserror.ENOENT
+ return nil, linuxerr.ENOENT
}
// TODO(gvisor.dev/issue/160): Linux requires only execute permission,
@@ -172,7 +171,7 @@ func loadExecutable(ctx context.Context, args LoadArgs) (loadedELF, arch.Context
// (e.g., #!a).
if err != nil && err != io.ErrUnexpectedEOF {
if err == io.EOF {
- err = syserror.ENOEXEC
+ err = linuxerr.ENOEXEC
}
return loadedELF{}, nil, nil, nil, err
}
@@ -190,7 +189,7 @@ func loadExecutable(ctx context.Context, args LoadArgs) (loadedELF, arch.Context
case bytes.Equal(hdr[:2], []byte(interpreterScriptMagic)):
if args.CloseOnExec {
- return loadedELF{}, nil, nil, nil, syserror.ENOENT
+ return loadedELF{}, nil, nil, nil, linuxerr.ENOENT
}
args.Filename, args.Argv, err = parseInterpreterScript(ctx, args.Filename, args.File, args.Argv)
if err != nil {
@@ -202,7 +201,7 @@ func loadExecutable(ctx context.Context, args LoadArgs) (loadedELF, arch.Context
default:
ctx.Infof("Unknown magic: %v", hdr)
- return loadedELF{}, nil, nil, nil, syserror.ENOEXEC
+ return loadedELF{}, nil, nil, nil, linuxerr.ENOEXEC
}
// Set to nil in case we loop on a Interpreter Script.
args.File = nil