mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 01:40:07 +00:00
Add f.Close() for applyOOMScoreAdj
This commit is contained in:
parent
e3fa011d28
commit
91d11ed703
@ -76,6 +76,12 @@ func applyOOMScoreAdj(pid int, oomScoreAdj int) error {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if _, err := f.Write([]byte(value)); err != nil {
|
if _, err := f.Write([]byte(value)); err != nil {
|
||||||
|
// we can ignore the return value of f.Close() here.
|
||||||
|
f.Close()
|
||||||
|
err = fmt.Errorf("failed to apply oom-score-adj to pid %d (%v)", pid, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if err = f.Close(); err != nil {
|
||||||
err = fmt.Errorf("failed to apply oom-score-adj to pid %d (%v)", pid, err)
|
err = fmt.Errorf("failed to apply oom-score-adj to pid %d (%v)", pid, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user