projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only inspect for proper FD
[pazpar2-moved-to-github.git]
/
src
/
eventl.c
diff --git
a/src/eventl.c
b/src/eventl.c
index
2808c07
..
39c243a
100644
(file)
--- a/
src/eventl.c
+++ b/
src/eventl.c
@@
-36,7
+36,9
@@
#include <stdio.h>
#include <assert.h>
#include <stdio.h>
#include <assert.h>
+#if HAVE_UNISTD_H
#include <unistd.h>
#include <unistd.h>
+#endif
#include <stdlib.h>
#include <errno.h>
#include <stdlib.h>
#include <errno.h>
@@
-251,6
+253,7
@@
static int event_loop(iochan_man_t man, IOCHAN *iochans)
}
for (p = start; p; p = p->next, i++)
{
}
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;
fds[i].client_data = p;
fds[i].fd = p->fd;
fds[i].input_mask = 0;
@@
-280,9
+283,9
@@
static int event_loop(iochan_man_t man, IOCHAN *iochans)
return 0;
}
}
return 0;
}
}
- i = 0;
if (man->sel_fd != -1)
{
if (man->sel_fd != -1)
{
+ i = 0;
assert(fds[i].fd == man->sel_fd);
if (fds[i].output_mask)
{
assert(fds[i].fd == man->sel_fd);
if (fds[i].output_mask)
{
@@
-298,7
+301,6
@@
static int event_loop(iochan_man_t man, IOCHAN *iochans)
chan->thread_users--;
}
}
chan->thread_users--;
}
}
- i++;
}
if (man->log_level)
{
}
if (man->log_level)
{
@@
-307,10
+309,10
@@
static int event_loop(iochan_man_t man, IOCHAN *iochans)
no++;
yaz_log(man->log_level, "%d channels", no);
}
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);
{
time_t now = time(0);
- p = fds[i].client_data;
+ i = p->poll_offset;
if (p->destroyed)
{
if (p->destroyed)
{
@@
-332,7
+334,7
@@
static int event_loop(iochan_man_t man, IOCHAN *iochans)
p->last_event = now;
p->this_event |= EVENT_TIMEOUT;
}
p->last_event = now;
p->this_event |= EVENT_TIMEOUT;
}
- if (fds[i].fd >= 0)
+ if (fds[i].fd >= 0 && p->fd == fds[i].fd)
{
if (fds[i].output_mask & yaz_poll_read)
{
{
if (fds[i].output_mask & yaz_poll_read)
{