From: Timo Sirainen Date: Mon, 7 Jun 2010 18:31:08 +0000 (+0100) Subject: master: Small code cleanup. X-Git-Tag: 2.0.beta6~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=feb0d6b8c57d563b98dd84d4f0a0ff29ea73a774;p=thirdparty%2Fdovecot%2Fcore.git master: Small code cleanup. --HG-- branch : HEAD --- diff --git a/src/master/main.c b/src/master/main.c index cb380e5d37..d5d0dadfbe 100644 --- a/src/master/main.c +++ b/src/master/main.c @@ -669,32 +669,29 @@ int main(int argc, char *argv[]) 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 {