From d3f53b134170a48d55b78f75999ddd19a9282f2d Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 3 Sep 2004 02:53:40 +0000 Subject: - Fixes to configuration file stuff --- common/smtppass.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'common/smtppass.c') diff --git a/common/smtppass.c b/common/smtppass.c index a9e8f9d..e985fa3 100644 --- a/common/smtppass.c +++ b/common/smtppass.c @@ -171,7 +171,7 @@ int main(int argc, char* argv[]) clstate_init(&g_state); /* Parse the arguments nicely */ - while((ch = getopt(argc, argv, "bc:d:D:h:l:m:p:qt:v")) != -1) + while((ch = getopt(argc, argv, "bc:d:D:f:h:l:m:p:qt:v")) != -1) { switch(ch) { @@ -267,7 +267,7 @@ int main(int argc, char* argv[]) } } - if(warnargs); + if(warnargs) warnx("please use configuration file instead of command-line flags: %s", configfile); argc -= optind; @@ -357,9 +357,13 @@ int main(int argc, char* argv[]) if(g_state.pidfile) pid_file(0); - clstate_cleanup(&g_state); messagex(NULL, LOG_DEBUG, "stopped"); + /* + * We have to do this at the very end because even printing + * messages requires that g_state is valid. + */ + clstate_cleanup(&g_state); return 0; } -- cgit v1.2.3