svn commit: samba r14890 - in branches/SAMBA_4_0/source/smbd: .

metze at samba.org metze at samba.org
Mon Apr 3 14:02:53 GMT 2006


Author: metze
Date: 2006-04-03 14:02:53 +0000 (Mon, 03 Apr 2006)
New Revision: 14890

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14890

Log:
fix the usage of popt...

I don't know why this causes problems on my laptop today...

anyway we have done this change in smbtorture month ago...

metze
Modified:
   branches/SAMBA_4_0/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_4_0/source/smbd/server.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/server.c	2006-04-03 13:53:57 UTC (rev 14889)
+++ branches/SAMBA_4_0/source/smbd/server.c	2006-04-03 14:02:53 UTC (rev 14890)
@@ -172,13 +172,17 @@
 	NTSTATUS status;
 	const char *model = "standard";
 	int max_runtime = 0;
+	enum {
+		OPT_INTERACTIVE		= 1000,
+		OPT_PROCESS_MODEL
+	};
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
-		{"interactive", 'i', POPT_ARG_VAL, &interactive, True, 
+		{"interactive",	'i', POPT_ARG_NONE, NULL, OPT_INTERACTIVE,
 		 "Run interactive (not a daemon)", NULL},
-		{"model", 'M', POPT_ARG_STRING, &model, True, 
+		{"model", 'M', POPT_ARG_STRING,	NULL, OPT_PROCESS_MODEL, 
 		 "Select process model", "MODEL"},
-		{"maximum-runtime", 0, POPT_ARG_INT, &max_runtime, True, 
+		{"maximum-runtime",0, POPT_ARG_INT, &max_runtime, 0, 
 		 "set maximum runtime of the server process, till autotermination", "seconds"},
 		POPT_COMMON_SAMBA
 		POPT_COMMON_VERSION
@@ -187,8 +191,16 @@
 
 	pc = poptGetContext(binary_name, argc, argv, long_options, 0);
 	
-	while((opt = poptGetNextOpt(pc)) != -1) /* noop */ ;
-
+	while((opt = poptGetNextOpt(pc)) != -1) {
+		switch(opt) {
+		case OPT_INTERACTIVE:
+			interactive = True;
+			break;
+		case OPT_PROCESS_MODEL:
+			model = poptGetOptArg(pc);
+			break;
+		}
+	}
 	poptFreeContext(pc);
 
 	setup_logging(binary_name, interactive?DEBUG_STDOUT:DEBUG_FILE);



More information about the samba-cvs mailing list