From cbf00d633db744febdac262ecfbc4908aa4e8a2f Mon Sep 17 00:00:00 2001 From: Adin Scannell Date: Thu, 8 Apr 2021 09:31:51 -0700 Subject: Clarify platform errors. PiperOrigin-RevId: 367446222 --- runsc/sandbox/sandbox.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runsc') diff --git a/runsc/sandbox/sandbox.go b/runsc/sandbox/sandbox.go index 450f92645..47da2dd10 100644 --- a/runsc/sandbox/sandbox.go +++ b/runsc/sandbox/sandbox.go @@ -486,7 +486,7 @@ func (s *Sandbox) createSandboxProcess(conf *config.Config, args *Args, startSyn } if deviceFile, err := gPlatform.OpenDevice(); err != nil { - return fmt.Errorf("opening device file for platform %q: %v", gPlatform, err) + return fmt.Errorf("opening device file for platform %q: %v", conf.Platform, err) } else if deviceFile != nil { defer deviceFile.Close() cmd.ExtraFiles = append(cmd.ExtraFiles, deviceFile) @@ -1174,7 +1174,7 @@ func deviceFileForPlatform(name string) (*os.File, error) { f, err := p.OpenDevice() if err != nil { - return nil, fmt.Errorf("opening device file for platform %q: %v", p, err) + return nil, fmt.Errorf("opening device file for platform %q: %w", name, err) } return f, nil } -- cgit v1.2.3