From c1fb904d1047359e8c4dadafaa0ab065efe9e03e Mon Sep 17 00:00:00 2001 From: Mabin Date: Wed, 4 Mar 2015 14:56:50 +0800 Subject: [PATCH] Add the file close operation before function return to release resource Signed-off-by: Mabin --- notify_linux.go | 1 + 1 file changed, 1 insertion(+) diff --git a/notify_linux.go b/notify_linux.go index db51d57d..cf81e24d 100644 --- a/notify_linux.go +++ b/notify_linux.go @@ -26,6 +26,7 @@ func notifyOnOOM(paths map[string]string) (<-chan struct{}, error) { } fd, _, syserr := syscall.RawSyscall(syscall.SYS_EVENTFD2, 0, syscall.FD_CLOEXEC, 0) if syserr != 0 { + oomControl.Close() return nil, syserr }