summaryrefslogtreecommitdiffabout
path: root/src/main.c
authorSergey Poznyakoff <gray@gnu.org>2016-10-28 17:36:29 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2016-10-28 17:46:42 (GMT)
commit8a851aaa1382d188ca2968e7bbd813e99507c4ff (patch) (side-by-side diff)
treef10b7611125dc5124a66a0a5cda7d544a93d14d1 /src/main.c
parentf964cda496a9e01e5c941da71a9841fb0c2b2174 (diff)
downloadmailfromd-8a851aaa1382d188ca2968e7bbd813e99507c4ff.tar.gz
mailfromd-8a851aaa1382d188ca2968e7bbd813e99507c4ff.tar.bz2
Finish conversion. Version 7.99.96
Diffstat (limited to 'src/main.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/main.c42
1 files changed, 7 insertions, 35 deletions
diff --git a/src/main.c b/src/main.c
index 2e14301..94b7f6b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -647,6 +647,7 @@ static char *capa[] = {
"logging",
"locking",
"mailer",
+ ".mfd:server",
NULL
};
@@ -1008,7 +1009,7 @@ mailfromd_show_defaults()
}
static int
-argpflag(int argc, char **argv)
+args_in_order(int argc, char **argv)
{
int i;
int flag = 0;
@@ -1017,16 +1018,15 @@ argpflag(int argc, char **argv)
if (len > 3
&& (memcmp(argv[i], "--ru", 4) == 0
|| memcmp(argv[i], "--run", 5) == 0)) {
- flag = ARGP_IN_ORDER;
- break;
+ return 1;
}
}
- return flag;
+ return 0;
}
static void
-provide_default_milter_server()
+provide_default_milter_server(void)
{
if (mfd_srvman_count_servers() == 0) {
mu_diag_output(MU_DIAG_WARNING,
@@ -1135,33 +1135,6 @@ struct mu_cli_setup cli = {
};
int
-mf_getopt(struct mu_cli_setup *cli, int *pargc, char ***pargv, char **capa)
-{
- struct mu_parseopt pohint;
- struct mu_cfg_parse_hints cfhint;
-
- cfhint.site_rcfile = DEFAULT_CONFIG_FILE;
- cfhint.flags = MU_CFG_PARSE_SITE_RCFILE;
-
- pohint.po_flags = 0;
-
- pohint.po_package_name = PACKAGE_NAME;
- pohint.po_flags |= MU_PARSEOPT_PACKAGE_NAME;
-
- pohint.po_package_url = PACKAGE_URL;
- pohint.po_flags |= MU_PARSEOPT_PACKAGE_URL;
-
- pohint.po_bug_address = PACKAGE_BUGREPORT;
- pohint.po_flags |= MU_PARSEOPT_BUG_ADDRESS;
-
- pohint.po_version_hook = mailfromd_version;
- pohint.po_flags |= MU_PARSEOPT_VERSION_HOOK;
-
- mu_cli_ext (*pargc, *pargv, cli, &pohint, &cfhint, capa, NULL,
- pargc, pargv);
-}
-
-int
main(int argc, char **argv)
{
int rc;
@@ -1206,12 +1179,11 @@ main(int argc, char **argv)
srvman_init();
mf_srvcfg_init(argv[0], "(milter | callout)");
- mf_getopt(&cli, &argc, &argv, capa);
+ mf_getopt(&cli, &argc, &argv, capa, args_in_order(argc, argv),
+ DEFAULT_CONFIG_FILE);
if (validate_options())
exit(EX_USAGE);
- if (rc)
- exit(EX_CONFIG);
init_relayed_domains();

Return to:

Send suggestions and report system problems to the System administrator.