mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-11-26 21:20:38 +00:00
Enforce non-zero timer timeout (0 means disabled)
This commit is contained in:
parent
8c9ce7a18b
commit
24c025368b
@ -217,6 +217,9 @@ evfilt_timer_knote_modify(struct filter *filt, struct knote *kn,
|
||||
kn->kev.flags = kev->flags;
|
||||
kn->kev.fflags = kev->fflags;
|
||||
|
||||
if (!kn->kev.data)
|
||||
kn->kev.data = 1;
|
||||
|
||||
convert_to_itimerspec(&ts, kn->kev.data, kn->kev.flags & EV_ONESHOT, kn->kev.fflags);
|
||||
if (timerfd_settime(tfd, 0, &ts, NULL) < 0) {
|
||||
dbg_printf("timerfd_settime(2): %s", strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user