diff --git a/daemon/daemon_unix.go b/daemon/daemon_unix.go index acfa7766b5..0fcde55fa8 100644 --- a/daemon/daemon_unix.go +++ b/daemon/daemon_unix.go @@ -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 }