dovecot-2.0: master: Small code cleanup.

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 7 21:31:11 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/cf496a6d669e
changeset: 11493:cf496a6d669e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 07 19:31:08 2010 +0100
description:
master: Small code cleanup.

diffstat:

 src/master/main.c |  49 +++++++++++++++++++++++--------------------------
 1 files changed, 23 insertions(+), 26 deletions(-)

diffs (59 lines):

diff -r fd447208ccb9 -r cf496a6d669e src/master/main.c
--- a/src/master/main.c	Mon Jun 07 19:28:15 2010 +0100
+++ b/src/master/main.c	Mon Jun 07 19:31:08 2010 +0100
@@ -669,32 +669,29 @@
 		execv_const(args[0], args);
 	}
 
-	while (optind < argc) {
-		if (!doubleopts[optind]) {
-			/* dovecot xx -> doveadm xx */
-			(void)execv(BINDIR"/doveadm", argv);
-			i_fatal("execv("BINDIR"/doveadm) failed: %m");
-		}
-
-		if (strcmp(argv[optind], "version") == 0) {
-			printf("%s\n", DOVECOT_VERSION_FULL);
-			return 0;
-		} else if (strcmp(argv[optind], "build-options") == 0) {
-			print_build_options();
-			return 0;
-		} else if (strcmp(argv[optind], "log-error") == 0) {
-			fprintf(stderr, "Writing to error logs and killing myself..\n");
-			argv[optind] = "log test";
-			(void)execv(BINDIR"/doveadm", argv);
-			i_fatal("execv("BINDIR"/doveadm) failed: %m");
-		} else if (strcmp(argv[optind], "help") == 0) {
-			print_help();
-			return 0;
-		} else {
-			print_help();
-			i_fatal("Unknown argument: --%s", argv[optind]);
-		}
-		optind++;
+	if (optind == argc) {
+		/* starting Dovecot */
+	} else if (!doubleopts[optind]) {
+		/* dovecot xx -> doveadm xx */
+		(void)execv(BINDIR"/doveadm", argv);
+		i_fatal("execv("BINDIR"/doveadm) failed: %m");
+	} else if (strcmp(argv[optind], "version") == 0) {
+		printf("%s\n", DOVECOT_VERSION_FULL);
+		return 0;
+	} else if (strcmp(argv[optind], "build-options") == 0) {
+		print_build_options();
+		return 0;
+	} else if (strcmp(argv[optind], "log-error") == 0) {
+		fprintf(stderr, "Writing to error logs and killing myself..\n");
+		argv[optind] = "log test";
+		(void)execv(BINDIR"/doveadm", argv);
+		i_fatal("execv("BINDIR"/doveadm) failed: %m");
+	} else if (strcmp(argv[optind], "help") == 0) {
+		print_help();
+		return 0;
+	} else {
+		print_help();
+		i_fatal("Unknown argument: --%s", argv[optind]);
 	}
 
 	do {


More information about the dovecot-cvs mailing list