]> git.llucax.com Git - software/libev.git/blobdiff - ev_kqueue.c
fix ns calculation in ev_kqueue
[software/libev.git] / ev_kqueue.c
index 2c33e547a8acf91d06221af273b6420f4f6b8459..851f7e5ca24769cc3b930d4a1dbae7ca2433f788 100644 (file)
@@ -88,7 +88,8 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
     }
 
   ts.tv_sec  = (time_t)timeout;
-  ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9;
+  ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9);
+  fprintf (stderr, "to %ld:%09ld %f\n", ts.tv_sec, ts.tv_nsec, res);//D
   res = kevent (kqueue_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts);
   kqueue_changecnt = 0;