projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix non-SOAP compile
[yaz-moved-to-github.git]
/
server
/
eventl.c
diff --git
a/server/eventl.c
b/server/eventl.c
index
aade89b
..
541bba4
100644
(file)
--- a/
server/eventl.c
+++ b/
server/eventl.c
@@
-1,9
+1,9
@@
/*
/*
- * Copyright (c) 1995-2001, Index Data
+ * Copyright (c) 1995-2003, Index Data
* See the file LICENSE for details.
* Sebastian Hammer, Adam Dickmeiss
*
* 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.35 2003-02-12 15:06:43 adam Exp $
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-60,6
+60,11
@@
int event_loop(IOCHAN *iochans)
static struct timeval nullto = {0, 0}, to;
struct timeval *timeout;
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);
FD_ZERO(&in);
FD_ZERO(&out);
FD_ZERO(&except);
@@
-69,6
+74,8
@@
int event_loop(IOCHAN *iochans)
max = 0;
for (p = *iochans; p; p = p->next)
{
max = 0;
for (p = *iochans; p; p = p->next)
{
+ yaz_log(LOG_LOG, "fd=%d flags=%d force_event=%d",
+ p->fd, p->flags, p->force_event);
if (p->force_event)
timeout = &nullto; /* polling select */
if (p->flags & EVENT_INPUT)
if (p->force_event)
timeout = &nullto; /* polling select */
if (p->flags & EVENT_INPUT)
@@
-80,11
+87,20
@@
int event_loop(IOCHAN *iochans)
if (p->fd > max)
max = p->fd;
}
if (p->fd > max)
max = p->fd;
}
+ yaz_log(LOG_LOG, "select start");
res = YAZ_EV_SELECT(max + 1, &in, &out, &except, timeout);
res = YAZ_EV_SELECT(max + 1, &in, &out, &except, timeout);
+ yaz_log(LOG_LOG, "select end");
if (res < 0)
{
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 */
else
{
/* Destroy the first member in the chain, and try again */