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 {
|
||||
return err
|
||||
}
|
||||
|
||||
defer f.Close()
|
||||
stringScore := strconv.Itoa(score)
|
||||
_, err = f.WriteString(stringScore)
|
||||
if os.IsPermission(err) {
|
||||
|
@ -1239,7 +1239,7 @@ func setupOOMScoreAdj(score int) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
f.Close()
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue