function setupOOMScoreAdj file close illogicality

Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
This commit is contained in:
chchliang 2016-11-18 15:56:52 +08:00
parent 27699ba8b2
commit e82fa89bcd

View file

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