diff options
author | Eric Wong <e@80x24.org> | 2019-06-24 02:52:47 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-24 05:26:27 +0000 |
commit | b86c1790854c6d8b8299e5b71ad067b97cff548b (patch) | |
tree | a0a01818e2ae99848b2ca0f1deb0e1872fd68a30 /lib | |
parent | 6ea82fb5d6cd5ae6813f3700fe915ab9110086ea (diff) | |
download | public-inbox-b86c1790854c6d8b8299e5b71ad067b97cff548b.tar.gz |
kqueue EV_ONESHOT semantics are different than epoll EPOLLONESHOT. epoll only disables watches for that event while keeping the item in the rbtree for future EPOLL_CTL_MOD. kqueue removes the watch from the filter set entirely, necessitating the use of EV_ADD for future modifications.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/DS.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index 0e48ed07..8f77ce24 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -321,7 +321,7 @@ sub kq_flag ($$) { my $fl = EV_ADD() | EV_ENABLE(); ($ev & EPOLLONESHOT) ? ($fl|EV_ONESHOT()) : $fl; } else { - EV_DISABLE(); + EV_ADD() | EV_DISABLE(); } } @@ -364,8 +364,8 @@ retry: } } elsif ($HaveKQueue) { - $KQueue->EV_SET($fd, EVFILT_READ(), EV_ADD() | kq_flag(EPOLLIN, $ev)); - $KQueue->EV_SET($fd, EVFILT_WRITE(), EV_ADD() | kq_flag(EPOLLOUT, $ev)); + $KQueue->EV_SET($fd, EVFILT_READ(), kq_flag(EPOLLIN, $ev)); + $KQueue->EV_SET($fd, EVFILT_WRITE(), kq_flag(EPOLLOUT, $ev)); } Carp::cluck("PublicInbox::DS::new blowing away existing descriptor map for fd=$fd ($DescriptorMap{$fd})") |