diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-01-20 04:14:20 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-01-22 12:37:29 +0100 |
commit | 048f8dba141c2f9898aad67e09925f03394a946e (patch) | |
tree | d975868b616cfc80d12df0979d21fb08a255c089 /source3/smbd/server.c | |
parent | f9dcd3d2b79e4c1e19ac1c81e3e75370c8716586 (diff) | |
download | samba-048f8dba141c2f9898aad67e09925f03394a946e.tar.gz samba-048f8dba141c2f9898aad67e09925f03394a946e.tar.xz samba-048f8dba141c2f9898aad67e09925f03394a946e.zip |
s3: always call run_events() before and after sys_select()
And always setup the fd events.
metze
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r-- | source3/smbd/server.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 42c37f20562..163d0b81bea 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -602,6 +602,10 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_ } } + if (run_events(smbd_event_context(), 0, NULL, NULL)) { + continue; + } + idle_timeout = timeval_zero(); memcpy((char *)&r_fds, (char *)&listen_set, @@ -623,6 +627,10 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_ timeval_is_zero(&idle_timeout) ? NULL : &idle_timeout); + if (run_events(smbd_event_context(), num, &r_fds, &w_fds)) { + continue; + } + if (num == -1 && errno == EINTR) { if (got_sig_term) { exit_server_cleanly(NULL); @@ -653,10 +661,6 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_ --num; } - if (run_events(smbd_event_context(), num, &r_fds, &w_fds)) { - continue; - } - /* check if we need to reload services */ check_reload(time(NULL)); |