- ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9;
- res = kevent (kqueue_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts);
+ ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9);
+ res = kevent (backend_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts);