1
0
Fork 0
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:
Brian Goff 2016-11-18 11:48:58 -05:00 committed by GitHub
commit 06e92cc2c1

View file

@ -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
} }