summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-08-18 12:35:02 -0400
committerSimo Sorce <idra@samba.org>2011-08-21 09:05:07 -0400
commit51d4b3c55d6e14f9bf9de24367f9f76ba20fa393 (patch)
treecd5a5a1c48b1fa7286af0eb10db8e37730789f68
parenta4188aaf7b415a2da7559e7b58a57f8af399d08e (diff)
downloadsamba-51d4b3c55d6e14f9bf9de24367f9f76ba20fa393.tar.gz
samba-51d4b3c55d6e14f9bf9de24367f9f76ba20fa393.tar.bz2
samba-51d4b3c55d6e14f9bf9de24367f9f76ba20fa393.zip
s3-prefork: Listening fds must be in non-blocking mode
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
-rw-r--r--source3/lib/server_prefork.c2
-rw-r--r--source3/lib/server_prefork.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/source3/lib/server_prefork.c b/source3/lib/server_prefork.c
index 016f65c5c3..a241e24798 100644
--- a/source3/lib/server_prefork.c
+++ b/source3/lib/server_prefork.c
@@ -83,6 +83,8 @@ bool prefork_create_pool(TALLOC_CTX *mem_ctx,
}
for (i = 0; i < listen_fd_size; i++) {
pfp->listen_fds[i] = listen_fds[i];
+ /* force sockets in non-blocking mode */
+ set_blocking(listen_fds[i], false);
}
pfp->main_fn = main_fn;
pfp->private_data = private_data;
diff --git a/source3/lib/server_prefork.h b/source3/lib/server_prefork.h
index 1d203e6317..703080bcd7 100644
--- a/source3/lib/server_prefork.h
+++ b/source3/lib/server_prefork.h
@@ -109,6 +109,9 @@ typedef void (prefork_sigchld_fn_t)(struct tevent_context *ev_ctx,
* @param pf_pool The allocated pool.
*
* @return True if it was successful, False otherwise.
+*
+* NOTE: each listen_fd is forced to non-blocking mode once handed over.
+* You should not toush listen_fds once you hand the to the prefork library.
*/
bool prefork_create_pool(TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,