summaryrefslogtreecommitdiff
path: root/sntp/libevent/kqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'sntp/libevent/kqueue.c')
-rw-r--r--sntp/libevent/kqueue.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sntp/libevent/kqueue.c b/sntp/libevent/kqueue.c
index 3933467..a6578df 100644
--- a/sntp/libevent/kqueue.c
+++ b/sntp/libevent/kqueue.c
@@ -332,6 +332,23 @@ kq_dispatch(struct event_base *base, struct timeval *tv)
* on FreeBSD. */
case EINVAL:
continue;
+#if defined(__FreeBSD__) && defined(ENOTCAPABLE)
+ /*
+ * This currently occurs if an FD is closed
+ * before the EV_DELETE makes it out via kevent().
+ * The FreeBSD capabilities code sees the blank
+ * capability set and rejects the request to
+ * modify an event.
+ *
+ * To be strictly correct - when an FD is closed,
+ * all the registered events are also removed.
+ * Queuing EV_DELETE to a closed FD is wrong.
+ * The event(s) should just be deleted from
+ * the pending changelist.
+ */
+ case ENOTCAPABLE:
+ continue;
+#endif
/* Can occur on a delete if the fd is closed. */
case EBADF: