From e82fa89bcd7118af9b1a7ef2f15748a9e879813d Mon Sep 17 00:00:00 2001 From: chchliang Date: Fri, 18 Nov 2016 15:56:52 +0800 Subject: [PATCH] function setupOOMScoreAdj file close illogicality Signed-off-by: chchliang --- daemon/daemon_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index 37c4bc09c4..5dff13c5df 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -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 }