mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Remove unused envv variable from two funcs.
PiperOrigin-RevId: 225041520 Change-Id: Ib1afc693e592d308d60db82022c5b7743fd3c646
This commit is contained in:
committed by
Shentubot
parent
77a443269a
commit
5934fad1d7
@@ -37,7 +37,7 @@ const (
|
||||
)
|
||||
|
||||
// parseInterpreterScript returns the interpreter path and argv.
|
||||
func parseInterpreterScript(ctx context.Context, filename string, f *fs.File, argv, envv []string) (newpath string, newargv []string, err error) {
|
||||
func parseInterpreterScript(ctx context.Context, filename string, f *fs.File, argv []string) (newpath string, newargv []string, err error) {
|
||||
line := make([]byte, interpMaxLineLength)
|
||||
n, err := readFull(ctx, f, usermem.BytesIOSequence(line), 0)
|
||||
// Short read is OK.
|
||||
|
||||
@@ -136,7 +136,7 @@ const (
|
||||
// * arch.Context matching the binary arch
|
||||
// * fs.Dirent of the binary file
|
||||
// * Possibly updated argv
|
||||
func loadPath(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespace, root, wd *fs.Dirent, remainingTraversals *uint, fs *cpuid.FeatureSet, filename string, argv, envv []string) (loadedELF, arch.Context, *fs.Dirent, []string, error) {
|
||||
func loadPath(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespace, root, wd *fs.Dirent, remainingTraversals *uint, fs *cpuid.FeatureSet, filename string, argv []string) (loadedELF, arch.Context, *fs.Dirent, []string, error) {
|
||||
for i := 0; i < maxLoaderAttempts; i++ {
|
||||
d, f, err := openPath(ctx, mounts, root, wd, remainingTraversals, filename)
|
||||
if err != nil {
|
||||
@@ -172,7 +172,7 @@ func loadPath(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespac
|
||||
d.IncRef()
|
||||
return loaded, ac, d, argv, err
|
||||
case bytes.Equal(hdr[:2], []byte(interpreterScriptMagic)):
|
||||
newpath, newargv, err := parseInterpreterScript(ctx, filename, f, argv, envv)
|
||||
newpath, newargv, err := parseInterpreterScript(ctx, filename, f, argv)
|
||||
if err != nil {
|
||||
ctx.Infof("Error loading interpreter script: %v", err)
|
||||
return loadedELF{}, nil, nil, nil, err
|
||||
@@ -198,7 +198,7 @@ func loadPath(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespac
|
||||
// * Load is called on the Task goroutine.
|
||||
func Load(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespace, root, wd *fs.Dirent, maxTraversals *uint, fs *cpuid.FeatureSet, filename string, argv, envv []string, extraAuxv []arch.AuxEntry, vdso *VDSO) (abi.OS, arch.Context, string, error) {
|
||||
// Load the binary itself.
|
||||
loaded, ac, d, argv, err := loadPath(ctx, m, mounts, root, wd, maxTraversals, fs, filename, argv, envv)
|
||||
loaded, ac, d, argv, err := loadPath(ctx, m, mounts, root, wd, maxTraversals, fs, filename, argv)
|
||||
if err != nil {
|
||||
ctx.Infof("Failed to load %s: %v", filename, err)
|
||||
return 0, nil, "", err
|
||||
|
||||
Reference in New Issue
Block a user