summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd_packets.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-20 04:14:20 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-22 12:37:29 +0100
commit048f8dba141c2f9898aad67e09925f03394a946e (patch)
treed975868b616cfc80d12df0979d21fb08a255c089 /source3/nmbd/nmbd_packets.c
parentf9dcd3d2b79e4c1e19ac1c81e3e75370c8716586 (diff)
downloadsamba-048f8dba141c2f9898aad67e09925f03394a946e.tar.gz
samba-048f8dba141c2f9898aad67e09925f03394a946e.tar.bz2
samba-048f8dba141c2f9898aad67e09925f03394a946e.zip
s3: always call run_events() before and after sys_select()
And always setup the fd events. metze
Diffstat (limited to 'source3/nmbd/nmbd_packets.c')
-rw-r--r--source3/nmbd/nmbd_packets.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index 66b584ad54..489034899e 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -1773,6 +1773,11 @@ bool listen_for_packets(bool run_election)
}
#endif
+ /* Process a signal and timer events now... */
+ if (run_events(nmbd_event_context(), 0, NULL, NULL)) {
+ return False;
+ }
+
/*
* During elections and when expecting a netbios response packet we
* need to send election packets at tighter intervals.
@@ -1789,13 +1794,6 @@ bool listen_for_packets(bool run_election)
&r_fds, &w_fds, &timeout, &maxfd);
}
- if (timeval_is_zero(&timeout)) {
- /* Process a timed event now... */
- if (run_events(nmbd_event_context(), 0, NULL, NULL)) {
- return False;
- }
- }
-
/* Prepare for the select - allow certain signals. */
BlockSignals(False, SIGTERM);
@@ -1806,11 +1804,11 @@ bool listen_for_packets(bool run_election)
BlockSignals(True, SIGTERM);
- if(selrtn == -1) {
+ if (run_events(nmbd_event_context(), selrtn, &r_fds, &w_fds)) {
return False;
}
- if (run_events(nmbd_event_context(), selrtn, &r_fds, &w_fds)) {
+ if (selrtn == -1) {
return False;
}