function setupOOMScoreAdj file close illogicality
Signed-off-by: chchliang <chen.chuanliang@zte.com.cn>
This commit is contained in:
parent
27699ba8b2
commit
e82fa89bcd
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue