X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Feventl.c;h=3eff731d771f0beb3263d685875e7fb9f41fc6cc;hb=944037cb95ef7a0eed6502fdea7541f2431b55cc;hp=d8d3536b51b52dc55afff35b48c092ad846ea27c;hpb=de185af5ab36376968640dea3b64ff1c8aee8cec;p=pazpar2-moved-to-github.git diff --git a/src/eventl.c b/src/eventl.c index d8d3536..3eff731 100644 --- a/src/eventl.c +++ b/src/eventl.c @@ -155,7 +155,7 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans) FD_ZERO(&out); FD_ZERO(&except); timeout = &to; /* hang on select */ - to.tv_sec = 15; + to.tv_sec = 300; to.tv_usec = 0; max = 0; for (p = *iochans; p; p = p->next) @@ -166,6 +166,8 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans) p->flags = (*p->maskfun)(p); if (p->socketfun) p->fd = (*p->socketfun)(p); + if (p->max_idle && p->max_idle < to.tv_sec) + to.tv_sec = p->max_idle; if (p->fd < 0) continue; if (p->force_event) @@ -178,8 +180,6 @@ static int event_loop(iochan_man_t man, IOCHAN *iochans) FD_SET(p->fd, &except); if (p->fd > max) max = p->fd; - if (p->max_idle && p->max_idle < to.tv_sec) - to.tv_sec = p->max_idle; } if (man->sel_fd != -1) {