From 8fd1304143e92ee0748173d2a6ee518057f7c62e Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Mon, 6 Jan 1986 03:57:07 -0800 Subject: [PATCH] cleanup for various compilation flags and reasonable organization SCCS-vsn: usr.sbin/sendmail/src/conf.h 5.7 SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.13 SCCS-vsn: usr.sbin/sendmail/src/daemon.c 5.17 SCCS-vsn: usr.sbin/sendmail/src/readcf.c 5.8 --- usr/src/usr.sbin/sendmail/src/conf.c | 33 +++++++++++++++++++++++++- usr/src/usr.sbin/sendmail/src/conf.h | 3 ++- usr/src/usr.sbin/sendmail/src/daemon.c | 10 ++++---- usr/src/usr.sbin/sendmail/src/readcf.c | 14 +++++++---- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/conf.c b/usr/src/usr.sbin/sendmail/src/conf.c index 98cee1524d..22b2bf522c 100644 --- a/usr/src/usr.sbin/sendmail/src/conf.c +++ b/usr/src/usr.sbin/sendmail/src/conf.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char SccsId[] = "@(#)conf.c 5.12 (Berkeley) %G%"; +static char SccsId[] = "@(#)conf.c 5.13 (Berkeley) %G%"; #endif not lint # include @@ -670,3 +670,34 @@ setproctitle(fmt, a, b, c) *p++ = ' '; # endif SETPROCTITLE } + /* +** REAPCHILD -- pick up the body of my child, lest it become a zombie +** +** Parameters: +** none. +** +** Returns: +** none. +** +** Side Effects: +** Picks up extant zombies. +*/ + +# ifdef VMUNIX +# include +# endif VMUNIX + +reapchild() +{ +# ifdef WNOHANG + union wait status; + + while (wait3(&status, WNOHANG, (struct rusage *) NULL) > 0) + continue; +# else WNOHANG + auto int status; + + while (wait(&status) > 0) + continue; +# endif WNOHANG +} diff --git a/usr/src/usr.sbin/sendmail/src/conf.h b/usr/src/usr.sbin/sendmail/src/conf.h index 34cad90729..71ad3741d7 100644 --- a/usr/src/usr.sbin/sendmail/src/conf.h +++ b/usr/src/usr.sbin/sendmail/src/conf.h @@ -7,7 +7,7 @@ ** All rights reserved. The Berkeley software License Agreement ** specifies the terms and conditions for redistribution. ** -** @(#)conf.h 5.6 (Berkeley) %G% +** @(#)conf.h 5.7 (Berkeley) %G% */ /* @@ -50,3 +50,4 @@ # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ # define FLOCK 1 /* use flock file locking */ # define SETPROCTITLE 1 /* munge argv to display current status */ +/* # define WIZ 1 /* allow wizard mode */ diff --git a/usr/src/usr.sbin/sendmail/src/daemon.c b/usr/src/usr.sbin/sendmail/src/daemon.c index 0e1e2dcbc3..df92b77188 100644 --- a/usr/src/usr.sbin/sendmail/src/daemon.c +++ b/usr/src/usr.sbin/sendmail/src/daemon.c @@ -15,7 +15,7 @@ # ifndef DAEMON # ifndef lint -static char SccsId[] = "@(#)daemon.c 5.16 (Berkeley) %G% (w/o daemon mode)"; +static char SccsId[] = "@(#)daemon.c 5.17 (Berkeley) %G% (w/o daemon mode)"; # endif not lint # else @@ -26,7 +26,7 @@ static char SccsId[] = "@(#)daemon.c 5.16 (Berkeley) %G% (w/o daemon mode)"; # include # ifndef lint -static char SccsId[] = "@(#)daemon.c 5.16 (Berkeley) %G% (with daemon mode)"; +static char SccsId[] = "@(#)daemon.c 5.17 (Berkeley) %G% (with daemon mode)"; # endif not lint /* @@ -55,8 +55,9 @@ static char SccsId[] = "@(#)daemon.c 5.16 (Berkeley) %G% (with daemon mode)"; ** appropriate for communication. Returns zero on ** success, else an exit status describing the ** error. -** -** The semantics of both of these should be clean. +** maphostname(hbuf, hbufsize) +** Convert the entry in hbuf into a canonical form. It +** may not be larger than hbufsize. */ static FILE *MailPort; /* port that mail comes in on */ @@ -485,5 +486,4 @@ maphostname(hbuf, hbsize) return; } - #endif DAEMON diff --git a/usr/src/usr.sbin/sendmail/src/readcf.c b/usr/src/usr.sbin/sendmail/src/readcf.c index 9a8f3963fa..e6463d2d18 100644 --- a/usr/src/usr.sbin/sendmail/src/readcf.c +++ b/usr/src/usr.sbin/sendmail/src/readcf.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char SccsId[] = "@(#)readcf.c 5.7 (Berkeley) %G%"; +static char SccsId[] = "@(#)readcf.c 5.8 (Berkeley) %G%"; #endif not lint # include "sendmail.h" @@ -606,8 +606,12 @@ printrules() */ static BITMAP StickyOpt; /* set if option is stuck */ -extern char *WizWord; /* the stored wizard password */ extern char *NetName; /* name of home (local) network */ +# ifdef SMTP +# ifdef WIZ +extern char *WizWord; /* the stored wizard password */ +# endif WIZ +# endif SMTP setoption(opt, val, sticky) char opt; @@ -820,11 +824,13 @@ setoption(opt, val, sticky) Verbose = atobool(val); break; -# ifdef DEBUG +# ifdef SMTP +# ifdef WIZ case 'W': /* set the wizards password */ WizWord = newstr(val); break; -# endif DEBUG +# endif WIZ +# endif SMTP case 'x': /* load avg at which to auto-queue msgs */ QueueLA = atoi(val); -- 2.20.1