mat813 / rb-kqueue

An FFI wrapper for kqueue
MIT License
22 stars 12 forks source link

Fix top level exception on unexpected event #12

Closed gridbugs closed 3 years ago

gridbugs commented 4 years ago

I started hitting this issue on FreeBSD 12: https://github.com/guard/listen/issues/475

I seem to be getting kqueue events with a filter of 0. It's not clear to me what the meaning of such an event is. Prior to this change I would see the behaviour in the linked issue. This patch causes these events to be ignored. I suspect this is just masking a bigger issue, but at least this makes the gem usable for me in the meantime.

I tested this by running a jekyll server on FreeBSD 12 with ruby 2.6.

trombik commented 3 years ago

the PR works for me.

> sysctl kern.osrelease kern.osrevision
kern.osrelease: 13.0-CURRENT
kern.osrevision: 199506
0mp commented 3 years ago

Fixes Jekyll live reload on my FreeBSD 13.0 (r365834)!

0mp commented 3 years ago

I've submitted a PR on FreeBSD Bugzilla to include this patch in the port: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250432

Thanks again for the patch