summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,