mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #28577 from chchliang/defercode
function setupOOMScoreAdj file close illogicality
This commit is contained in:
commit
06e92cc2c1
1 changed files with 2 additions and 2 deletions
|
@ -1227,7 +1227,7 @@ func setupOOMScoreAdj(score int) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer f.Close()
|
||||||
stringScore := strconv.Itoa(score)
|
stringScore := strconv.Itoa(score)
|
||||||
_, err = f.WriteString(stringScore)
|
_, err = f.WriteString(stringScore)
|
||||||
if os.IsPermission(err) {
|
if os.IsPermission(err) {
|
||||||
|
@ -1239,7 +1239,7 @@ func setupOOMScoreAdj(score int) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
f.Close()
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue