diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2003-09-19 23:11:30 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2003-09-19 23:11:30 +0000 |
commit | 96b960fca637a0765d566591885b7d42576e723f (patch) | |
tree | e6205d213aedfefacf00b4211611f436bae5e680 /contrib/sendmail/src/main.c | |
parent | ac5ff30ae19ff6f7473f23c0d36d94301124b150 (diff) | |
download | FreeBSD-src-96b960fca637a0765d566591885b7d42576e723f.zip FreeBSD-src-96b960fca637a0765d566591885b7d42576e723f.tar.gz |
Import sendmail 8.12.10
Diffstat (limited to 'contrib/sendmail/src/main.c')
-rw-r--r-- | contrib/sendmail/src/main.c | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/contrib/sendmail/src/main.c b/contrib/sendmail/src/main.c index dbe9ce5..a56315c 100644 --- a/contrib/sendmail/src/main.c +++ b/contrib/sendmail/src/main.c @@ -25,7 +25,7 @@ SM_UNUSED(static char copyright[]) = The Regents of the University of California. All rights reserved.\n"; #endif /* ! lint */ -SM_RCSID("@(#)$Id: main.c,v 8.887.2.22 2003/03/06 18:38:08 ca Exp $") +SM_RCSID("@(#)$Id: main.c,v 8.887.2.27 2003/08/04 17:23:37 ca Exp $") #if NETINET || NETINET6 @@ -940,16 +940,18 @@ main(argc, argv, envp) *p++ = '\0'; if (*p != '\0') { - ep = sm_malloc_x(strlen(p) + 1); - cleanstrcpy(ep, p, MAXNAME); + i = strlen(p) + 1; + ep = sm_malloc_x(i); + cleanstrcpy(ep, p, i); macdefine(&BlankEnvelope.e_macro, A_HEAP, 's', ep); } } if (*optarg != '\0') { - ep = sm_malloc_x(strlen(optarg) + 1); - cleanstrcpy(ep, optarg, MAXNAME); + i = strlen(optarg) + 1; + ep = sm_malloc_x(i); + cleanstrcpy(ep, optarg, i); macdefine(&BlankEnvelope.e_macro, A_HEAP, 'r', ep); } @@ -2368,13 +2370,7 @@ main(argc, argv, envp) pid_t ret; int group; - if (ShutdownRequest != NULL) - shutdown_daemon(); - else if (RestartRequest != NULL) - restart_daemon(); - else if (RestartWorkGroup) - restart_marked_work_groups(); - + CHECK_RESTART; while ((ret = sm_wait(&status)) <= 0) continue; @@ -2392,8 +2388,9 @@ main(argc, argv, envp) "persistent queue runner=%d core dumped, signal=%d", group, WTERMSIG(status)); - /* don't restart this one */ - mark_work_group_restart(group, -1); + /* don't restart this */ + mark_work_group_restart( + group, -1); continue; } @@ -2414,7 +2411,8 @@ main(argc, argv, envp) sm_syslog(LOG_DEBUG, NOQID, "persistent queue runner=%d, exited", group); - mark_work_group_restart(group, -1); + mark_work_group_restart(group, + -1); } } finis(true, true, ExitStat); @@ -2443,13 +2441,7 @@ main(argc, argv, envp) for (;;) { (void) pause(); - if (ShutdownRequest != NULL) - shutdown_daemon(); - else if (RestartRequest != NULL) - restart_daemon(); - else if (RestartWorkGroup) - restart_marked_work_groups(); - + CHECK_RESTART; if (doqueuerun()) (void) runqueue(true, false, false, false); @@ -2643,7 +2635,7 @@ main(argc, argv, envp) /* collect body for UUCP return */ if (OpMode != MD_VERIFY) - collect(InChannel, false, NULL, &MainEnvelope); + collect(InChannel, false, NULL, &MainEnvelope, true); finis(true, true, EX_USAGE); /* NOTREACHED */ } @@ -2703,7 +2695,7 @@ main(argc, argv, envp) MainEnvelope.e_flags &= ~EF_FATALERRS; Errors = 0; buffer_errors(); - collect(InChannel, false, NULL, &MainEnvelope); + collect(InChannel, false, NULL, &MainEnvelope, true); /* header checks failed */ if (Errors > 0) |