mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 14:13:58 +08:00
libct/cg.WriteCgroupProcs: improve errors
No need to add a file name to the error messages, as errors from OpenFile and (*os.File).Write both contain the file name already. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -352,7 +352,7 @@ func WriteCgroupProc(dir string, pid int) error {
|
||||
|
||||
file, err := OpenFile(dir, CgroupProcesses, os.O_WRONLY)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to write %v to %v: %w", pid, CgroupProcesses, err)
|
||||
return fmt.Errorf("failed to write %v: %w", pid, err)
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
@@ -369,7 +369,7 @@ func WriteCgroupProc(dir string, pid int) error {
|
||||
continue
|
||||
}
|
||||
|
||||
return fmt.Errorf("failed to write %v to %v: %w", pid, CgroupProcesses, err)
|
||||
return fmt.Errorf("failed to write %v: %w", pid, err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user