summaryrefslogtreecommitdiff
path: root/contrib/sendmail/src/queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/src/queue.c')
-rw-r--r--contrib/sendmail/src/queue.c47
1 files changed, 13 insertions, 34 deletions
diff --git a/contrib/sendmail/src/queue.c b/contrib/sendmail/src/queue.c
index 65e777ac5aba3..24b789a251b8f 100644
--- a/contrib/sendmail/src/queue.c
+++ b/contrib/sendmail/src/queue.c
@@ -14,9 +14,9 @@
#ifndef lint
#if QUEUE
-static char sccsid[] = "@(#)queue.c 8.210 (Berkeley) 10/15/1998 (with queueing)";
+static char sccsid[] = "@(#)queue.c 8.202 (Berkeley) 6/15/98 (with queueing)";
#else
-static char sccsid[] = "@(#)queue.c 8.210 (Berkeley) 10/15/1998 (without queueing)";
+static char sccsid[] = "@(#)queue.c 8.202 (Berkeley) 6/15/98 (without queueing)";
#endif
#endif /* not lint */
@@ -611,7 +611,7 @@ runqueue(forkflag, verbose)
{
/* parent -- pick up intermediate zombie */
(void) blocksignal(SIGALRM);
- proc_list_add(pid, "Queue runner");
+ proc_list_add(pid);
(void) releasesignal(SIGALRM);
releasesignal(SIGCHLD);
if (QueueIntvl != 0)
@@ -619,17 +619,13 @@ runqueue(forkflag, verbose)
return TRUE;
}
/* child -- double fork and clean up signals */
- clrcontrol();
proc_list_clear();
-
- /* Add parent process as first child item */
- proc_list_add(getpid(), "Queue runner child process");
releasesignal(SIGCHLD);
(void) setsignal(SIGCHLD, SIG_DFL);
(void) setsignal(SIGHUP, intsig);
}
- sm_setproctitle(TRUE, "running queue: %s", QueueDir);
+ setproctitle("running queue: %s", QueueDir);
if (LogLevel > 69)
sm_syslog(LOG_DEBUG, NOQID,
@@ -754,6 +750,7 @@ runqueue(forkflag, verbose)
else
{
pid_t pid;
+ extern pid_t dowork __P((char *, bool, bool, ENVELOPE *));
if (Verbose)
{
@@ -774,7 +771,7 @@ runqueue(forkflag, verbose)
/* exit without the usual cleanup */
e->e_id = NULL;
- finis(TRUE, ExitStat);
+ finis();
/*NOTREACHED*/
return TRUE;
}
@@ -896,16 +893,7 @@ orderq(doall)
continue;
if (strlen(d->d_name) > MAXQFNAME)
- {
- if (Verbose)
- printf("orderq: %s too long, %d max characters\n",
- d->d_name, MAXQFNAME);
- if (LogLevel > 0)
- sm_syslog(LOG_ALERT, NOQID,
- "orderq: %s too long, %d max characters",
- d->d_name, MAXQFNAME);
continue;
- }
check = QueueLimitId;
while (check != NULL)
@@ -1455,16 +1443,6 @@ dowork(id, forkflag, requeueflag, e)
{
/* child -- error messages to the transcript */
QuickAbort = OnlyOneError = FALSE;
-
- /*
- ** Since the delivery may happen in a child and the
- ** parent does not wait, the parent may close the
- ** maps thereby removing any shared memory used by
- ** the map. Therefore, open a copy of the maps for
- ** the delivery process.
- */
-
- initmaps(FALSE, e);
}
}
else
@@ -1496,7 +1474,7 @@ dowork(id, forkflag, requeueflag, e)
disconnect(1, e);
OpMode = MD_DELIVER;
}
- sm_setproctitle(TRUE, "%s: from queue", id);
+ setproctitle("%s: from queue", id);
if (LogLevel > 76)
sm_syslog(LOG_DEBUG, e->e_id,
"dowork, pid=%d",
@@ -1512,7 +1490,7 @@ dowork(id, forkflag, requeueflag, e)
printf("readqf(%s) failed\n", e->e_id);
e->e_id = NULL;
if (forkflag)
- finis(FALSE, EX_OK);
+ exit(EX_OK);
else
return 0;
}
@@ -1528,7 +1506,7 @@ dowork(id, forkflag, requeueflag, e)
/* finish up and exit */
if (forkflag)
- finis(TRUE, ExitStat);
+ finis();
else
dropenvelope(e, TRUE);
}
@@ -1799,6 +1777,7 @@ readqf(e)
curtime() < e->e_dtime + MinQueueAge)
{
char *howlong = pintvl(curtime() - e->e_dtime, TRUE);
+ extern void unlockqueue __P((ENVELOPE *));
if (Verbose || tTd(40, 8))
printf("%s: too young (%s)\n",
@@ -2206,7 +2185,7 @@ queuename(e, type)
continue;
syserr("queuename: Cannot create \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_UNAVAILABLE);
+ exit(EX_UNAVAILABLE);
}
do
{
@@ -2233,7 +2212,7 @@ queuename(e, type)
{
syserr("queuename: Cannot lock \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_OSERR);
+ exit(EX_OSERR);
}
/* a reader got the file; abandon it and try again */
@@ -2243,7 +2222,7 @@ queuename(e, type)
{
syserr("queuename: Cannot create \"%s\" in \"%s\" (euid=%d)",
qf, QueueDir, geteuid());
- finis(FALSE, EX_OSERR);
+ exit(EX_OSERR);
}
e->e_id = newstr(&qf[2]);
define('i', e->e_id, e);