summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 00:37:22 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-14 00:48:59 +0200
commit29b0453cf15913b321ea423b7f81fdee55eb4409 (patch)
tree6fde0b109b8c1b88cc99fe51c4a574325b0fbf0d
parentIntroduce rwcancel (diff)
downloadwireguard-go-29b0453cf15913b321ea423b7f81fdee55eb4409.tar.xz
wireguard-go-29b0453cf15913b321ea423b7f81fdee55eb4409.zip
Send event on erroring kqueue
-rw-r--r--uapi_darwin.go5
1 files changed, 5 insertions, 0 deletions
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)