function setupOOMScoreAdj file close illogicality
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn> Upstream-commit: e82fa89bcd7118af9b1a7ef2f15748a9e879813d Component: engine
This commit is contained in:
@ -1230,7 +1230,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) {
|
||||
@ -1242,7 +1242,7 @@ func setupOOMScoreAdj(score int) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
f.Close()
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user