[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha4-106-gfa6c007

Stefan Metzmacher metze at samba.org
Fri Jun 20 09:07:06 GMT 2008


The branch, v4-0-test has been updated
       via  fa6c00734ccf9bfe7a962253ddb5e2a1722c9b09 (commit)
      from  87385e4c873f80956dc1c43424dd4f49a993586c (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit fa6c00734ccf9bfe7a962253ddb5e2a1722c9b09
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jun 20 11:03:12 2008 +0200

    smbd: make sure the parent smbd stays alive forever
    
    The problem was that the parent smbd doesn't have
    any event when the process model standard was in use.
    
    Now we always add an fd event for stdin, but may not
    ask for any events to trigger.
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 source/smbd/server.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/server.c b/source/smbd/server.c
index 74c87c6..5bd5568 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -202,6 +202,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
 	init_module_fn static_init[] = { STATIC_smbd_MODULES };
 	init_module_fn *shared_init;
 	struct event_context *event_ctx;
+	uint16_t stdin_event_flags;
 	NTSTATUS status;
 	const char *model = "standard";
 	int max_runtime = 0;
@@ -324,15 +325,20 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
 	cluster_ctdb_init(cmdline_lp_ctx, event_ctx, model);
 
 	if (opt_interactive) {
-		/* catch EOF on stdin */
-#ifdef SIGTTIN
-		signal(SIGTTIN, SIG_IGN);
-#endif
-		event_add_fd(event_ctx, event_ctx, 0, EVENT_FD_READ, 
-			     server_stdin_handler,
-			     discard_const(binary_name));
+		/* terminate when stdin goes away */
+		stdin_event_flags = EVENT_FD_READ;
+	} else {
+		/* stay alive forever */
+		stdin_event_flags = 0;
 	}
 
+	/* catch EOF on stdin */
+#ifdef SIGTTIN
+	signal(SIGTTIN, SIG_IGN);
+#endif
+	event_add_fd(event_ctx, event_ctx, 0, stdin_event_flags,
+		     server_stdin_handler,
+		     discard_const(binary_name));
 
 	if (max_runtime) {
 		event_add_timed(event_ctx, event_ctx, 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list