/[svn]/branches/newio/src/ioengine_epoll.c
ViewVC logotype

Diff of /branches/newio/src/ioengine_epoll.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2414 by michael, Sat Jul 13 22:13:28 2013 UTC revision 2415 by michael, Sun Jul 21 14:33:22 2013 UTC
# Line 35  Line 35 
35  #include <errno.h>  #include <errno.h>
36  #include <sys/types.h>  #include <sys/types.h>
37  #ifdef HAVE_STDINT_H  #ifdef HAVE_STDINT_H
38  #include <stdint.h> /* bah */  #include <stdint.h>
39  #endif  #endif
40  #include <string.h>  #include <string.h>
41  #include <sys/epoll.h>  #include <sys/epoll.h>
# Line 259  engine_loop(struct Generators *gen) Line 259  engine_loop(struct Generators *gen)
259    struct epoll_event *events;    struct epoll_event *events;
260    struct Socket *sock;    struct Socket *sock;
261    socklen_t codesize;    socklen_t codesize;
262    int events_count, i, wait, nevs, errcode;    int events_count, i, iwait, nevs, errcode;
263    
264    if ((events_count = 64 /* XXX */) < 20)    if ((events_count = 64 /* XXX */) < 20)
265      events_count = 20;      events_count = 20;
# Line 271  engine_loop(struct Generators *gen) Line 271  engine_loop(struct Generators *gen)
271        events_count = i;        events_count = i;
272      }      }
273    
274      wait = timer_next(gen) ? (timer_next(gen) - CurrentTime) * 1000 : -1;      iwait = timer_next(gen) ? (timer_next(gen) - CurrentTime) * 1000 : -1;
275      ilog(LOG_TYPE_DEBUG, "epoll: delay: %d (%d) %d", timer_next(gen),      ilog(LOG_TYPE_DEBUG, "epoll: delay: %d (%d) %d", timer_next(gen),
276           CurrentTime, wait);           CurrentTime, iwait);
277      nevs = epoll_wait(epoll_fd, events, events_count, wait);      nevs = epoll_wait(epoll_fd, events, events_count, iwait);
278      set_time();;      set_time();
279    
280      if (nevs < 0) {      if (nevs < 0) {
281        if (errno != EINTR) {        if (errno != EINTR) {

Legend:
Removed from v.2414  
changed lines
  Added in v.2415

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28