mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-11-23 03:39:51 +00:00
Workaround an issue caused by a flag
When we pass back EV_VANISHED to libdispatch, it thinks we're telling it the source vanished (because that's really what it means) and it explodes
This commit is contained in:
parent
3c34d903b4
commit
9a94fadf15
@ -107,6 +107,9 @@ struct kevent {
|
||||
#define EV_RECEIPT 0x0040 /* force EV_ERROR on success, data=0 */
|
||||
#define EV_DISPATCH 0x0080 /* disable event after reporting */
|
||||
|
||||
#define EV_UDATA_SPECIFIC 0x0100 /* unique kevent per udata value */
|
||||
#define EV_VANISHED 0x0200 /* report that source has vanished */
|
||||
|
||||
#define EV_SYSFLAGS 0xF000 /* reserved by system */
|
||||
#define EV_FLAG1 0x2000 /* filter-specific flag */
|
||||
|
||||
|
@ -147,6 +147,12 @@ kevent_copyin_one(struct kqueue *kq, const struct kevent64_s *src)
|
||||
kn->kn_kq = kq;
|
||||
assert(filt->kn_create);
|
||||
|
||||
// TODO: actually handle EV_VANISHED
|
||||
// this is necessary for now because if we pass back EV_VANISHED, it indicates
|
||||
// the source has vanished. we want to do that once we start properly handling it and checking for it,
|
||||
// but at the moment it just confuses clients
|
||||
kn->kev.flags &= ~EV_VANISHED;
|
||||
|
||||
if (filt->kn_create(filt, kn) < 0) {
|
||||
knote_release(kn);
|
||||
errno = EBADF;
|
||||
|
Loading…
Reference in New Issue
Block a user