X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Feventl.c;h=b914bf3914551dd1ffd632b838e1754227887fd6;hb=19b85891163749971c8e15f9ccca76cc4c5bb9bc;hp=148ddd7a7dbcc574e104d7a654740a61b4f02d31;hpb=909e8c6b0e1a8a679bf3a3979fb8d2e8a1c96703;p=pazpar2-moved-to-github.git diff --git a/src/eventl.c b/src/eventl.c index 148ddd7..b914bf3 100644 --- a/src/eventl.c +++ b/src/eventl.c @@ -253,6 +253,7 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans) } for (p = start; p; p = p->next, i++) { + p->poll_offset = i; fds[i].client_data = p; fds[i].fd = p->fd; fds[i].input_mask = 0; @@ -282,9 +283,9 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans) return 0; } } - i = 0; if (man->sel_fd != -1) { + i = 0; assert(fds[i].fd == man->sel_fd); if (fds[i].output_mask) { @@ -300,7 +301,6 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans) chan->thread_users--; } } - i++; } if (man->log_level) { @@ -309,10 +309,10 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans) no++; yaz_log(man->log_level, "%d channels", no); } - for (; i < no_fds; i++) + for (p = start; p; p = p->next) { time_t now = time(0); - p = fds[i].client_data; + i = p->poll_offset; if (p->destroyed) {