From 6f08a100410fb61093df5321b685b07ff8b801e6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 9 Feb 2021 20:18:21 +0100 Subject: rwcancel: add an explicit close call This lets us collect FDs even if the GC doesn't do it for us. Signed-off-by: Jason A. Donenfeld --- ipc/uapi_linux.go | 1 + 1 file changed, 1 insertion(+) (limited to 'ipc') diff --git a/ipc/uapi_linux.go b/ipc/uapi_linux.go index 3213543..e03a00b 100644 --- a/ipc/uapi_linux.go +++ b/ipc/uapi_linux.go @@ -99,6 +99,7 @@ func UAPIListen(name string, file *os.File) (net.Listener, error) { go func(l *UAPIListener) { var buff [0]byte for { + defer uapi.inotifyRWCancel.Close() // start with lstat to avoid race condition if _, err := os.Lstat(socketPath); os.IsNotExist(err) { l.connErr <- err -- cgit v1.2.3