fix references to h_errno that weren't in #ifdef NAMED_BIND
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 8 Feb 1994 23:55:57 +0000 (15:55 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 8 Feb 1994 23:55:57 +0000 (15:55 -0800)
SCCS-vsn: usr.sbin/sendmail/src/daemon.c 8.36

usr/src/usr.sbin/sendmail/src/daemon.c

index e5b66a3..8a9d7a9 100644 (file)
@@ -12,9 +12,9 @@
 
 #ifndef lint
 #ifdef DAEMON
 
 #ifndef lint
 #ifdef DAEMON
-static char sccsid[] = "@(#)daemon.c   8.35 (Berkeley) %G% (with daemon mode)";
+static char sccsid[] = "@(#)daemon.c   8.36 (Berkeley) %G% (with daemon mode)";
 #else
 #else
-static char sccsid[] = "@(#)daemon.c   8.35 (Berkeley) %G% (without daemon mode)";
+static char sccsid[] = "@(#)daemon.c   8.36 (Berkeley) %G% (without daemon mode)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -753,7 +753,9 @@ host_map_lookup(map, name, av, statp)
        register STAB *s;
        char hbuf[MAXNAME];
        extern struct hostent *gethostbyaddr();
        register STAB *s;
        char hbuf[MAXNAME];
        extern struct hostent *gethostbyaddr();
+#ifdef NAMED_BIND
        extern int h_errno;
        extern int h_errno;
+#endif
 
        /*
        **  See if we have already looked up this name.  If so, just
 
        /*
        **  See if we have already looked up this name.  If so, just
@@ -767,7 +769,9 @@ host_map_lookup(map, name, av, statp)
                        printf("host_map_lookup(%s) => CACHE %s\n",
                                name, s->s_namecanon.nc_cname);
                errno = s->s_namecanon.nc_errno;
                        printf("host_map_lookup(%s) => CACHE %s\n",
                                name, s->s_namecanon.nc_cname);
                errno = s->s_namecanon.nc_errno;
+#ifdef NAMED_BIND
                h_errno = s->s_namecanon.nc_herrno;
                h_errno = s->s_namecanon.nc_herrno;
+#endif
                *statp = s->s_namecanon.nc_stat;
                if (CurEnv->e_message == NULL && *statp == EX_TEMPFAIL)
                {
                *statp = s->s_namecanon.nc_stat;
                if (CurEnv->e_message == NULL && *statp == EX_TEMPFAIL)
                {
@@ -805,10 +809,11 @@ host_map_lookup(map, name, av, statp)
                {
                        register struct hostent *hp;
 
                {
                        register struct hostent *hp;
 
-                       if (tTd(9, 1))
-                               printf("FAIL (%d)\n", h_errno);
                        s->s_namecanon.nc_errno = errno;
                        s->s_namecanon.nc_errno = errno;
+#ifdef NAMED_BIND
                        s->s_namecanon.nc_herrno = h_errno;
                        s->s_namecanon.nc_herrno = h_errno;
+                       if (tTd(9, 1))
+                               printf("FAIL (%d)\n", h_errno);
                        switch (h_errno)
                        {
                          case TRY_AGAIN:
                        switch (h_errno)
                        {
                          case TRY_AGAIN:
@@ -835,6 +840,11 @@ host_map_lookup(map, name, av, statp)
                                *statp = EX_UNAVAILABLE;
                                break;
                        }
                                *statp = EX_UNAVAILABLE;
                                break;
                        }
+#else
+                       if (tTd(9, 1))
+                               printf("FAIL\n");
+                       *statp = EX_NOHOST;
+#endif
                        s->s_namecanon.nc_stat = *statp;
                        if (*statp != EX_TEMPFAIL || UseNameServer)
                                return NULL;
                        s->s_namecanon.nc_stat = *statp;
                        if (*statp != EX_TEMPFAIL || UseNameServer)
                                return NULL;
@@ -865,7 +875,9 @@ host_map_lookup(map, name, av, statp)
        /* nope -- ask the name server */
        hp = gethostbyaddr((char *)&in_addr, sizeof(struct in_addr), AF_INET);
        s->s_namecanon.nc_errno = errno;
        /* nope -- ask the name server */
        hp = gethostbyaddr((char *)&in_addr, sizeof(struct in_addr), AF_INET);
        s->s_namecanon.nc_errno = errno;
+#ifdef NAMED_BIND
        s->s_namecanon.nc_herrno = h_errno;
        s->s_namecanon.nc_herrno = h_errno;
+#endif
        s->s_namecanon.nc_flags |= NCF_VALID;           /* will be soon */
        if (hp == NULL)
        {
        s->s_namecanon.nc_flags |= NCF_VALID;           /* will be soon */
        if (hp == NULL)
        {