clean up #ifdef configuration to more cleanly match the modern age
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 6 Jan 1992 01:21:46 +0000 (17:21 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 6 Jan 1992 01:21:46 +0000 (17:21 -0800)
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 5.19
SCCS-vsn: usr.sbin/sendmail/src/main.c 5.43
SCCS-vsn: usr.sbin/sendmail/src/conf.h 5.24
SCCS-vsn: usr.sbin/sendmail/src/err.c 5.13
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.91
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 5.29
SCCS-vsn: usr.sbin/sendmail/src/Makefile 5.24
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 5.53
SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.34

usr/src/usr.sbin/sendmail/src/Makefile
usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/conf.h
usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/err.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/sendmail.h
usr/src/usr.sbin/sendmail/src/usersmtp.c
usr/src/usr.sbin/sendmail/src/version.c

index 613f90b..563cd57 100644 (file)
@@ -1,8 +1,8 @@
-#      @(#)Makefile    5.23 (Berkeley) %G%
+#      @(#)Makefile    5.24 (Berkeley) %G%
 
 PROG=  sendmail
 
 
 PROG=  sendmail
 
-CFLAGS+=-I${.CURDIR} -DVMUNIX
+CFLAGS+=-I${.CURDIR}
 
 SRCS=  alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
        deliver.c domain.c envelope.c err.c headers.c macro.c main.c \
 
 SRCS=  alias.c arpadate.c clock.c collect.c conf.c convtime.c daemon.c \
        deliver.c domain.c envelope.c err.c headers.c macro.c main.c \
index f2cb662..4f52a74 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     5.33 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     5.34 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <sys/ioctl.h>
 #endif /* not lint */
 
 # include <sys/ioctl.h>
@@ -21,9 +21,6 @@ static char sccsid[] = "@(#)conf.c    5.33 (Berkeley) %G%";
 **
 **     Defines the configuration of this installation.
 **
 **
 **     Defines the configuration of this installation.
 **
-**     Compilation Flags:
-**             VMUNIX -- running on a Berkeley UNIX system.
-**
 **     Configuration Variables:
 **             HdrInfo -- a table describing well-known header fields.
 **                     Each entry has the field name and some flags,
 **     Configuration Variables:
 **             HdrInfo -- a table describing well-known header fields.
 **                     Each entry has the field name and some flags,
@@ -601,9 +598,7 @@ setproctitle(fmt, a, b, c)
 **             Picks up extant zombies.
 */
 
 **             Picks up extant zombies.
 */
 
-# ifdef VMUNIX
 # include <sys/wait.h>
 # include <sys/wait.h>
-# endif VMUNIX
 
 void
 reapchild()
 
 void
 reapchild()
index 3045369..da6ed92 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      5.23 (Berkeley) %G%
+ *     @(#)conf.h      5.24 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -31,6 +31,9 @@
 # define QUEUESIZE     600             /* max # of jobs per queue run */
 # define MAXMXHOSTS    10              /* max # of MX records */
 # define SMTPLINELIM   990             /* maximum SMTP line length */
 # define QUEUESIZE     600             /* max # of jobs per queue run */
 # define MAXMXHOSTS    10              /* max # of MX records */
 # define SMTPLINELIM   990             /* maximum SMTP line length */
+# ifndef FORK
+# define FORK          vfork           /* function to call to fork mailer */
+# endif
 
 /*
 **  Compilation options.
 
 /*
 **  Compilation options.
index 1df8e93..9a539c1 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)deliver.c  5.52 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c  5.53 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -535,11 +535,10 @@ markfailure(e, q, rcode)
 */
 
 # define NFORKTRIES    5
 */
 
 # define NFORKTRIES    5
-# ifdef VMUNIX
-# define XFORK vfork
-# else VMUNIX
-# define XFORK fork
-# endif VMUNIX
+
+# ifndef FORK
+# define FORK  fork
+# endif
 
 # define DOFORK(fORKfN) \
 {\
 
 # define DOFORK(fORKfN) \
 {\
@@ -748,11 +747,9 @@ openmailer(m, pvp, ctladdr, clever, pmfile, prfile)
        if (strcmp(m->m_mailer, "[IPC]") == 0 ||
            strcmp(m->m_mailer, "[TCP]") == 0)
        {
        if (strcmp(m->m_mailer, "[IPC]") == 0 ||
            strcmp(m->m_mailer, "[TCP]") == 0)
        {
-#ifdef HOSTINFO
+#ifdef DAEMON
                register STAB *st;
                extern STAB *stab();
                register STAB *st;
                extern STAB *stab();
-#endif HOSTINFO
-#ifdef DAEMON
                register int i, j;
                register u_short port;
 
                register int i, j;
                register u_short port;
 
@@ -766,7 +763,6 @@ openmailer(m, pvp, ctladdr, clever, pmfile, prfile)
                for (j = 0; j < Nmx; j++)
                {
                        CurHostName = MxHosts[j];
                for (j = 0; j < Nmx; j++)
                {
                        CurHostName = MxHosts[j];
-#ifdef HOSTINFO
                        /* see if we already know that this host is fried */
                        st = stab(MxHosts[j], ST_HOST, ST_FIND);
                        if (st == NULL || st->s_host.ho_exitstat == EX_OK)
                        /* see if we already know that this host is fried */
                        st = stab(MxHosts[j], ST_HOST, ST_FIND);
                        if (st == NULL || st->s_host.ho_exitstat == EX_OK)
@@ -782,21 +778,13 @@ openmailer(m, pvp, ctladdr, clever, pmfile, prfile)
                                i = st->s_host.ho_exitstat;
                                errno = st->s_host.ho_errno;
                        }
                                i = st->s_host.ho_exitstat;
                                errno = st->s_host.ho_errno;
                        }
-#else HOSTINFO
-                       message(Arpa_Info, "Connecting to %s (%s)...",
-                               MxHosts[j], m->m_name);
-                       i = makeconnection(MxHosts[j], port, pmfile, prfile,
-                               bitnset(M_SECURE_PORT, m->m_flags);
-#endif HOSTINFO
                        if (i != EX_OK)
                        {
                        if (i != EX_OK)
                        {
-#ifdef HOSTINFO
                                /* enter status of this host */
                                if (st == NULL)
                                        st = stab(MxHosts[j], ST_HOST, ST_ENTER);
                                st->s_host.ho_exitstat = i;
                                st->s_host.ho_errno = errno;
                                /* enter status of this host */
                                if (st == NULL)
                                        st = stab(MxHosts[j], ST_HOST, ST_ENTER);
                                st->s_host.ho_exitstat = i;
                                st->s_host.ho_errno = errno;
-#endif HOSTINFO
                                ExitStat = i;
                                continue;
                        }
                                ExitStat = i;
                                continue;
                        }
@@ -842,7 +830,7 @@ openmailer(m, pvp, ctladdr, clever, pmfile, prfile)
 # ifdef SIGCHLD
        (void) signal(SIGCHLD, SIG_DFL);
 # endif SIGCHLD
 # ifdef SIGCHLD
        (void) signal(SIGCHLD, SIG_DFL);
 # endif SIGCHLD
-       DOFORK(XFORK);
+       DOFORK(FORK);
        /* pid is set by DOFORK */
        if (pid < 0)
        {
        /* pid is set by DOFORK */
        if (pid < 0)
        {
index a27ee5b..da3b19b 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c      5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -325,7 +325,7 @@ errstring(errno)
 # endif SMTP
 
 # ifdef DAEMON
 # endif SMTP
 
 # ifdef DAEMON
-# ifdef VMUNIX
+# ifdef ETIMEDOUT
        /*
        **  Handle special network error codes.
        **
        /*
        **  Handle special network error codes.
        **
@@ -365,8 +365,8 @@ errstring(errno)
                (void) sprintf(buf, "Host Name Lookup Failure");
                return (buf);
        }
                (void) sprintf(buf, "Host Name Lookup Failure");
                return (buf);
        }
-# endif VMUNIX
-# endif DAEMON
+# endif
+# endif
 
        if (errno > 0 && errno < sys_nerr)
                return (sys_errlist[errno]);
 
        if (errno > 0 && errno < sys_nerr)
                return (sys_errlist[errno]);
index b236f48..419e4a8 100644 (file)
@@ -13,7 +13,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     5.42 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     5.43 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -144,11 +144,16 @@ main(argc, argv, envp)
        extern ADDRESS *recipient();
        bool canrename;
 
        extern ADDRESS *recipient();
        bool canrename;
 
+#ifdef SYSTEM5
        /* Enforce use of local time (null string overrides this) */
        if (TimeZoneSpec == NULL)
                unsetenv("TZ");
        else if (TimeZoneSpec[0] != '\0')
                setenv("TZ", TimeZoneSpec);
        /* Enforce use of local time (null string overrides this) */
        if (TimeZoneSpec == NULL)
                unsetenv("TZ");
        else if (TimeZoneSpec[0] != '\0')
                setenv("TZ", TimeZoneSpec);
+#else
+       /* enforce use of kernel-supplied time zone information */
+       unsetenv("TZ");
+#endif
 
        /*
        **  Be sure we have enough file descriptors.
 
        /*
        **  Be sure we have enough file descriptors.
index c64362b..7657bde 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  5.28 (Berkeley) %G%
+ *     @(#)sendmail.h  5.29 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 5.28            %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 5.29            %G%";
 # endif lint
 # else  _DEFINE
 # define EXTERN extern
 # endif lint
 # else  _DEFINE
 # define EXTERN extern
@@ -35,10 +35,8 @@ static char SmailSccsId[] =  "@(#)sendmail.h 5.28            %G%";
 # endif LOG
 
 # ifdef DAEMON
 # endif LOG
 
 # ifdef DAEMON
-# ifdef VMUNIX
 # include <sys/socket.h>
 # include <netinet/in.h>
 # include <sys/socket.h>
 # include <netinet/in.h>
-# endif VMUNIX
 # endif DAEMON
 
 
 # endif DAEMON
 
 
@@ -362,7 +360,6 @@ struct metamac
 */
 
 # ifdef DAEMON
 */
 
 # ifdef DAEMON
-# ifdef VMUNIX
 
 # define HOSTINFO      struct hostinfo
 
 
 # define HOSTINFO      struct hostinfo
 
@@ -379,7 +376,6 @@ HOSTINFO
 /* flag bits */
 #define HOF_VALID      00001           /* this entry is valid */
 
 /* flag bits */
 #define HOF_VALID      00001           /* this entry is valid */
 
-# endif VMUNIX
 # endif DAEMON
 \f/*
 **  Symbol table definitions
 # endif DAEMON
 \f/*
 **  Symbol table definitions
index 2e78ee6..b37c2d3 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)usersmtp.c 5.18 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 5.19 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)usersmtp.c 5.18 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 5.19 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -70,8 +70,10 @@ smtpinit(m, pvp)
 {
        register int r;
        EVENT *gte;
 {
        register int r;
        EVENT *gte;
+       register STAB *st;
        char buf[MAXNAME];
        static int greettimeout();
        char buf[MAXNAME];
        static int greettimeout();
+       extern STAB *stab();
 
        /*
        **  Open the connection to the mailer.
 
        /*
        **  Open the connection to the mailer.
@@ -207,26 +209,19 @@ smtpinit(m, pvp)
        smtpquit(m);
        return (EX_PROTOCOL);
 
        smtpquit(m);
        return (EX_PROTOCOL);
 
-       /* signal a temporary failure */
   tempfail1:
   tempfail1:
-#ifdef HOSTINFO
-       {
-               register STAB *st;
-               extern STAB *stab();
-
-               /* log this as an error to avoid sure-to-be-void connections */
-               st = stab(CurHostName, ST_HOST, ST_ENTER);
-               st->s_host.ho_exitstat = EX_TEMPFAIL;
-               st->s_host.ho_errno = errno;
-       }
-#endif /* HOSTINFO */
+       /* log this as an error to avoid sure-to-be-void connections */
+       st = stab(CurHostName, ST_HOST, ST_ENTER);
+       st->s_host.ho_exitstat = EX_TEMPFAIL;
+       st->s_host.ho_errno = errno;
 
   tempfail2:
 
   tempfail2:
+       /* signal a temporary failure */
        smtpquit(m);
        return (EX_TEMPFAIL);
 
        smtpquit(m);
        return (EX_TEMPFAIL);
 
-       /* signal service unavailable */
   unavailable:
   unavailable:
+       /* signal service unavailable */
        smtpquit(m);
        return (EX_UNAVAILABLE);
 }
        smtpquit(m);
        return (EX_UNAVAILABLE);
 }
index 83186bf..0f398d4 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)version.c  5.90 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c  5.91 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-char   Version[] = "5.90";
+char   Version[] = "5.91";