Skip to content

Commit

Permalink
Add EPOLLONESHOT if EV_ONESHOT or EV_DISPATCH
Browse files Browse the repository at this point in the history
  • Loading branch information
ianpartridge committed May 26, 2016
1 parent d1a1fe9 commit ea35db4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/linux/timer.c
Expand Up @@ -151,7 +151,10 @@ evfilt_timer_knote_create(struct filter *filt, struct knote *kn)
}

memset(&ev, 0, sizeof(ev));
ev.events = EPOLLIN;
ev.events = EPOLLIN | EPOLLET;
if (kn->kev.flags & EV_ONESHOT || kn->kev.flags & EV_DISPATCH)
ev.events |= EPOLLONESHOT;

ev.data.ptr = kn;
if (epoll_ctl(filter_epfd(filt), EPOLL_CTL_ADD, tfd, &ev) < 0) {
dbg_printf("epoll_ctl(2): %d", errno);
Expand Down

0 comments on commit ea35db4

Please sign in to comment.