summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-01-24 08:47:38 +0100
committerStefan Metzmacher <metze@samba.org>2011-01-31 16:16:09 +0100
commit19d3779274314bb4ce76e3afaa21cf37de7b2b98 (patch)
treeb7063d6abd080fd0fefa8cb7f07822fb06f4d2e5 /source3/lib
parent1537f5dab1d947fddee05b27c7feb5c7e83e83a2 (diff)
downloadsamba-19d3779274314bb4ce76e3afaa21cf37de7b2b98.tar.gz
samba-19d3779274314bb4ce76e3afaa21cf37de7b2b98.tar.bz2
samba-19d3779274314bb4ce76e3afaa21cf37de7b2b98.zip
Revert "s3:events: Call all ready fd event handlers on each iteration of the main loop"
This reverts commit 455fccf86b6544cd17a2571c63a88f8aebff3f74. I'll add a more generic fix for this problem. metze
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/events.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c
index d987072884..7670eb1f10 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -68,7 +68,7 @@ bool event_add_to_select_args(struct tevent_context *ev,
}
bool run_events(struct tevent_context *ev,
- int *selrtn, fd_set *read_fds, fd_set *write_fds)
+ int selrtn, fd_set *read_fds, fd_set *write_fds)
{
struct tevent_fd *fde;
struct timeval now;
@@ -113,7 +113,7 @@ bool run_events(struct tevent_context *ev,
return true;
}
- if (*selrtn <= 0) {
+ if (selrtn == 0) {
/*
* No fd ready
*/
@@ -123,16 +123,8 @@ bool run_events(struct tevent_context *ev,
for (fde = ev->fd_events; fde; fde = fde->next) {
uint16 flags = 0;
- if (FD_ISSET(fde->fd, read_fds)) {
- flags |= EVENT_FD_READ;
- FD_CLR(fde->fd, read_fds);
- (*selrtn)--;
- }
- if (FD_ISSET(fde->fd, write_fds)) {
- flags |= EVENT_FD_WRITE;
- FD_CLR(fde->fd, write_fds);
- (*selrtn)--;
- }
+ if (FD_ISSET(fde->fd, read_fds)) flags |= EVENT_FD_READ;
+ if (FD_ISSET(fde->fd, write_fds)) flags |= EVENT_FD_WRITE;
if (flags & fde->flags) {
fde->handler(ev, fde, flags, fde->private_data);
@@ -171,7 +163,7 @@ static int s3_event_loop_once(struct tevent_context *ev, const char *location)
struct timeval to;
fd_set r_fds, w_fds;
int maxfd = 0;
- int ret = 0;
+ int ret;
FD_ZERO(&r_fds);
FD_ZERO(&w_fds);
@@ -179,7 +171,7 @@ static int s3_event_loop_once(struct tevent_context *ev, const char *location)
to.tv_sec = 9999; /* Max timeout */
to.tv_usec = 0;
- if (run_events(ev, &ret, NULL, NULL)) {
+ if (run_events(ev, 0, NULL, NULL)) {
return 0;
}
@@ -196,7 +188,7 @@ static int s3_event_loop_once(struct tevent_context *ev, const char *location)
return -1;
}
- run_events(ev, &ret, &r_fds, &w_fds);
+ run_events(ev, ret, &r_fds, &w_fds);
return 0;
}