summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-20 01:58:04 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-22 12:37:28 +0100
commitf9dcd3d2b79e4c1e19ac1c81e3e75370c8716586 (patch)
treee61e53c876051263ae544db4f2327c28980c0e45 /source3
parent3b34486f6aaeb81376d9522a01bc6b69d34b4572 (diff)
downloadsamba-f9dcd3d2b79e4c1e19ac1c81e3e75370c8716586.tar.gz
samba-f9dcd3d2b79e4c1e19ac1c81e3e75370c8716586.tar.bz2
samba-f9dcd3d2b79e4c1e19ac1c81e3e75370c8716586.zip
s3:events: always run_events() before sys_select()
We might have pending signal events not only timed events. metze
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/events.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/lib/events.c b/source3/lib/events.c
index 74f30a709a..4484d5323b 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -180,17 +180,16 @@ static int s3_event_loop_once(struct tevent_context *ev)
to.tv_sec = 9999; /* Max timeout */
to.tv_usec = 0;
+ if (run_events(ev, 0, NULL, NULL)) {
+ return 0;
+ }
+
GetTimeOfDay(&now);
if (!event_add_to_select_args(ev, &now, &r_fds, &w_fds, &to, &maxfd)) {
return -1;
}
- if (timeval_is_zero(&to)) {
- run_events(ev, 0, NULL, NULL);
- return 0;
- }
-
ret = sys_select(maxfd+1, &r_fds, &w_fds, NULL, &to);
if (ret == -1 && errno != EINTR) {