From 4ace7950d4fbd074611865eee816e748c56b7b83 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2007 07:45:41 +0000 Subject: r23702: fixed a "falling back to select" error in the standard process model. It's much cleaner to get the event system to close the fd, especially with the complexity of forks (This used to be commit d1b710f09c95a8181d2b642081282d8c97b37811) --- source4/smbd/service_stream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/smbd') diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index f3f3a67e78..39c7dda227 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -289,9 +289,13 @@ NTSTATUS stream_setup_socket(struct event_context *event_context, return status; } + /* we will close the socket using the events system */ + socket_set_flags(stream_socket->sock, SOCKET_FLAG_NOCLOSE); + event_add_fd(event_context, stream_socket->sock, socket_get_fd(stream_socket->sock), - EVENT_FD_READ, stream_accept_handler, stream_socket); + EVENT_FD_READ|EVENT_FD_AUTOCLOSE, + stream_accept_handler, stream_socket); stream_socket->private = talloc_reference(stream_socket, private); stream_socket->ops = stream_ops; -- cgit