Send event on erroring kqueue

This commit is contained in:
Jason A. Donenfeld 2018-05-14 00:37:22 +02:00
parent 7e10ebe101
commit 29b0453cf1

View file

@ -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)