ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.261 by root, Mon Sep 29 03:31:14 2008 UTC vs.
Revision 1.263 by root, Wed Oct 1 18:50:03 2008 UTC

287# endif 287# endif
288#endif 288#endif
289 289
290#if EV_USE_INOTIFY 290#if EV_USE_INOTIFY
291# include <sys/inotify.h> 291# include <sys/inotify.h>
292/* some very old inotify.h headers don't have IN_DONT_FOLLOW */
293# ifndef IN_DONT_FOLLOW
294# undef EV_USE_INOTIFY
295# define EV_USE_INOTIFY 0
296# endif
292#endif 297#endif
293 298
294#if EV_SELECT_IS_WINSOCKET 299#if EV_SELECT_IS_WINSOCKET
295# include <winsock.h> 300# include <winsock.h>
296#endif 301#endif
3012} 3017}
3013 3018
3014static void 3019static void
3015once_cb_io (EV_P_ ev_io *w, int revents) 3020once_cb_io (EV_P_ ev_io *w, int revents)
3016{ 3021{
3017 once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io)), revents); 3022 struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io));
3023
3024 once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->to));
3018} 3025}
3019 3026
3020static void 3027static void
3021once_cb_to (EV_P_ ev_timer *w, int revents) 3028once_cb_to (EV_P_ ev_timer *w, int revents)
3022{ 3029{
3023 once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to)), revents); 3030 struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to));
3031
3032 once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->io));
3024} 3033}
3025 3034
3026void 3035void
3027ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg) 3036ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg)
3028{ 3037{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines