X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=server%2Feventl.c;h=ce38bd8ae78900d986874f990f03c98c4010e39c;hb=9287c96097c00d28310becb14ea3dd7cfb9f2ab0;hp=aade89bc9484b3786285f724b53498cb31c6b4b8;hpb=b81a371f23d16b616e6f7355ec7345cf8a482511;p=yaz-moved-to-github.git diff --git a/server/eventl.c b/server/eventl.c index aade89b..ce38bd8 100644 --- a/server/eventl.c +++ b/server/eventl.c @@ -3,7 +3,7 @@ * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Id: eventl.c,v 1.31 2001-10-05 14:43:22 adam Exp $ + * $Id: eventl.c,v 1.34 2002-11-26 16:56:21 adam Exp $ */ #include @@ -60,6 +60,11 @@ int event_loop(IOCHAN *iochans) static struct timeval nullto = {0, 0}, to; struct timeval *timeout; + if (statserv_must_terminate()) + { + for (p = *iochans; p; p = p->next) + p->force_event = EVENT_TIMEOUT; + } FD_ZERO(&in); FD_ZERO(&out); FD_ZERO(&except); @@ -83,8 +88,15 @@ int event_loop(IOCHAN *iochans) res = YAZ_EV_SELECT(max + 1, &in, &out, &except, timeout); if (res < 0) { - if (errno == EINTR) - continue; + if (yaz_errno() == EINTR) + { + if (statserv_must_terminate()) + { + for (p = *iochans; p; p = p->next) + p->force_event = EVENT_TIMEOUT; + } + continue; + } else { /* Destroy the first member in the chain, and try again */