r23702: fixed a "falling back to select" error in the standard process
authorAndrew Tridgell <tridge@samba.org>
Wed, 4 Jul 2007 07:45:41 +0000 (07:45 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:59:05 +0000 (14:59 -0500)
model. It's much cleaner to get the event system to close the fd,
especially with the complexity of forks

source/smbd/service_stream.c

index f3f3a67e787a8611bc2860f3a660d73e07b9769d..39c7dda227e958e2817f8c3d68f98a4f12665c47 100644 (file)
@@ -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;