Skip to content

Instantly share code, notes, and snippets.

@jedisct1
Created August 27, 2012 07:10
Show Gist options
  • Save jedisct1/3486404 to your computer and use it in GitHub Desktop.
Save jedisct1/3486404 to your computer and use it in GitHub Desktop.
fix-timeout-comp.diff
diff --git a/opendnscache/lib-opendnscache/fdevent_kqueue.c b/opendnscache/lib-opendnscache/fdevent_kqueue.c
index df3d645..f77c015 100644
--- a/opendnscache/lib-opendnscache/fdevent_kqueue.c
+++ b/opendnscache/lib-opendnscache/fdevent_kqueue.c
@@ -92,7 +92,7 @@ fdevent_wait(int64_t deadline, int64_t now)
timeout = 0;
}
timeout_ts.tv_sec = timeout / 1000;
- timeout_ts.tv_nsec = timeout % 1000;
+ timeout_ts.tv_nsec = (timeout % 1000) * 1000000;
if ((ready = kevent(kqueuefd, NULL, 0, t_events, events_len,
timeout_ts_p)) < 0
&& errno != EINTR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment