From 29b0453cf15913b321ea423b7f81fdee55eb4409 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 14 May 2018 00:37:22 +0200 Subject: [PATCH] Send event on erroring kqueue --- uapi_darwin.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/uapi_darwin.go b/uapi_darwin.go index 449fb98..0f6d904 100644 --- a/uapi_darwin.go +++ b/uapi_darwin.go @@ -109,6 +109,11 @@ func UAPIListen(name string, file *os.File) (net.Listener, error) { return } if kerr != nil || n != 1 { + if kerr != nil { + l.connErr <- kerr + } else { + l.connErr <- errors.New("kqueue returned empty") + } return } n, kerr = unix.Kevent(uapi.kqueueFd, []unix.Kevent_t{event}, events, nil)