Unicos portability changes
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 16 Jan 1994 04:38:55 +0000 (20:38 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 16 Jan 1994 04:38:55 +0000 (20:38 -0800)
SCCS-vsn: usr.sbin/sendmail/src/main.c 8.47
SCCS-vsn: usr.sbin/sendmail/src/domain.c 8.11
SCCS-vsn: usr.sbin/sendmail/src/err.c 8.20
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 8.24

usr/src/usr.sbin/sendmail/src/domain.c
usr/src/usr.sbin/sendmail/src/err.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/srvrsmtp.c

index 40ddb6f..afdf2de 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef NAMED_BIND
 
 #ifndef lint
 #ifdef NAMED_BIND
-static char sccsid[] = "@(#)domain.c   8.10 (Berkeley) %G% (with name server)";
+static char sccsid[] = "@(#)domain.c   8.11 (Berkeley) %G% (with name server)";
 #else
 #else
-static char sccsid[] = "@(#)domain.c   8.10 (Berkeley) %G% (without name server)";
+static char sccsid[] = "@(#)domain.c   8.11 (Berkeley) %G% (without name server)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -43,6 +43,10 @@ static char  MXHostBuf[MAXMXHOSTS*PACKETSZ];
 # define NO_DATA       NO_ADDRESS
 #endif
 
 # define NO_DATA       NO_ADDRESS
 #endif
 
+#ifndef HEADERSZ
+# define HEADERSZ      sizeof(HEADER)
+#endif
+
 /* don't use sizeof because sizeof(long) is different on 64-bit machines */
 #define SHORTSIZE      2       /* size of a short (really, must be 2) */
 #define LONGSIZE       4       /* size of a long (really, must be 4) */
 /* don't use sizeof because sizeof(long) is different on 64-bit machines */
 #define SHORTSIZE      2       /* size of a short (really, must be 2) */
 #define LONGSIZE       4       /* size of a long (really, must be 4) */
@@ -156,7 +160,7 @@ getmxrr(host, mxhosts, droplocalhost, rcode)
 
        /* find first satisfactory answer */
        hp = (HEADER *)&answer;
 
        /* find first satisfactory answer */
        hp = (HEADER *)&answer;
-       cp = (u_char *)&answer + sizeof(HEADER);
+       cp = (u_char *)&answer + HEADERSZ;
        eom = (u_char *)&answer + n;
        for (qdcount = ntohs(hp->qdcount); qdcount--; cp += n + QFIXEDSZ)
                if ((n = dn_skipname(cp, eom)) < 0)
        eom = (u_char *)&answer + n;
        for (qdcount = ntohs(hp->qdcount); qdcount--; cp += n + QFIXEDSZ)
                if ((n = dn_skipname(cp, eom)) < 0)
@@ -535,7 +539,7 @@ cnameloop:
                */
 
                hp = (HEADER *) &answer;
                */
 
                hp = (HEADER *) &answer;
-               ap = (u_char *) &answer + sizeof(HEADER);
+               ap = (u_char *) &answer + HEADERSZ;
                eom = (u_char *) &answer + ret;
 
                /* skip question part of response -- we know what we asked */
                eom = (u_char *) &answer + ret;
 
                /* skip question part of response -- we know what we asked */
index 506a6d9..c87a2c2 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      8.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c      8.20 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -408,18 +408,18 @@ fmtmsg(eb, to, num, eno, fmt, ap)
 **  ERRSTRING -- return string description of error code
 **
 **     Parameters:
 **  ERRSTRING -- return string description of error code
 **
 **     Parameters:
-**             errno -- the error number to translate
+**             errnum -- the error number to translate
 **
 **     Returns:
 **
 **     Returns:
-**             A string description of errno.
+**             A string description of errnum.
 **
 **     Side Effects:
 **             none.
 */
 
 const char *
 **
 **     Side Effects:
 **             none.
 */
 
 const char *
-errstring(errno)
-       int errno;
+errstring(errnum)
+       int errnum;
 {
        char *dnsmsg;
        static char buf[MAXLINE];
 {
        char *dnsmsg;
        static char buf[MAXLINE];
@@ -438,12 +438,12 @@ errstring(errno)
        */
 
        dnsmsg = NULL;
        */
 
        dnsmsg = NULL;
-       switch (errno)
+       switch (errnum)
        {
 # if defined(DAEMON) && defined(ETIMEDOUT)
          case ETIMEDOUT:
          case ECONNRESET:
        {
 # if defined(DAEMON) && defined(ETIMEDOUT)
          case ETIMEDOUT:
          case ECONNRESET:
-               (void) strcpy(buf, sys_errlist[errno]);
+               (void) strcpy(buf, sys_errlist[errnum]);
                if (SmtpPhase != NULL)
                {
                        (void) strcat(buf, " during ");
                if (SmtpPhase != NULL)
                {
                        (void) strcat(buf, " during ");
@@ -507,9 +507,9 @@ errstring(errno)
                return buf;
        }
 
                return buf;
        }
 
-       if (errno > 0 && errno < sys_nerr)
-               return (sys_errlist[errno]);
+       if (errnum > 0 && errnum < sys_nerr)
+               return (sys_errlist[errnum]);
 
 
-       (void) sprintf(buf, "Error %d", errno);
+       (void) sprintf(buf, "Error %d", errnum);
        return (buf);
 }
        return (buf);
 }
index 7615748..65e6317 100644 (file)
@@ -13,13 +13,12 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     8.46 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     8.47 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #define        _DEFINE
 
 #include "sendmail.h"
-#include <sgtty.h>
 #ifdef NAMED_BIND
 #include <arpa/nameser.h>
 #include <resolv.h>
 #ifdef NAMED_BIND
 #include <arpa/nameser.h>
 #include <resolv.h>
index 9cd4002..3f8b2a5 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.23 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.24 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)srvrsmtp.c 8.23 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.24 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -134,11 +134,15 @@ smtp(e)
        for (;;)
        {
                /* arrange for backout */
        for (;;)
        {
                /* arrange for backout */
-               if (setjmp(TopFrame) > 0 && InChild)
+               if (setjmp(TopFrame) > 0)
                {
                {
-                       QuickAbort = FALSE;
-                       SuprErrs = TRUE;
-                       finis();
+                       /* if() nesting is necessary for Cray UNICOS */
+                       if (InChild)
+                       {
+                               QuickAbort = FALSE;
+                               SuprErrs = TRUE;
+                               finis();
+                       }
                }
                QuickAbort = FALSE;
                HoldErrs = FALSE;
                }
                QuickAbort = FALSE;
                HoldErrs = FALSE;