[comp.bugs.4bsd] IDA - Sendmail 5.61 - h_errno undefined

cudcv@warwick.ac.uk (Rob McMahon) (03/26/89)

deliver.c uses/checks h_errno several times, but this should be done only if
NAMED_BIND is defined, else this can fail to compile on compilers that don't
follow the `common model' of externals.  Half these patches are due to the IDA
patches, the other half are in sendmail itself.

RCS file: deliver.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** /tmp/,RCSt1a08424	Sat Mar 25 16:04:01 1989
--- /tmp/,RCSt2a08424	Sat Mar 25 16:04:03 1989
***************
*** 70,75 ****
--- 70,76 ----
  	/* SIGUSR2 */	"user-defined signal 2"
  };
  
+ #ifdef	NAMED_BIND
  /*
  **  Name server error messages
  */
***************
*** 81,88 ****
  	/* NO_RECOVERY */	"Non recoverable name server error",
  	/* NO_DATA */		"Valid name but no data [address]"
  };
  
- 
  /*
  **  DELIVER -- Deliver a message to a list of addresses.
  **
--- 82,89 ----
  	/* NO_RECOVERY */	"Non recoverable name server error",
  	/* NO_DATA */		"Valid name but no data [address]"
  };
+ #endif	NAMED_BIND
  
  /*
  **  DELIVER -- Deliver a message to a list of addresses.
  **
***************
*** 1004,1010 ****
  	register char *statmsg;
  	extern char *SysExMsg[];
  	register int i;
! 	extern int N_SysEx, h_errno;
  	char buf[MAXLINE];
  
  #ifdef lint
--- 1005,1014 ----
  	register char *statmsg;
  	extern char *SysExMsg[];
  	register int i;
! 	extern int N_SysEx;
! #ifdef	NAMED_BIND
! 	extern int h_errno;
! #endif	NAMED_BIND
  	char buf[MAXLINE];
  
  #ifdef lint
***************
*** 1028,1033 ****
--- 1032,1038 ----
  	else if (stat == EX_TEMPFAIL)
  	{
  		(void) strcpy(buf, SysExMsg[i]);
+ #ifdef	NAMED_BIND
  		if (h_errno == TRY_AGAIN)
  		{
  			extern char *errstring();
***************
*** 1035,1040 ****
--- 1040,1046 ----
  			statmsg = errstring(h_errno+MAX_ERRNO);
  		}
  		else
+ #endif	NAMED_BIND
  		{
  			if (errno != 0)
  			{
***************
*** 1076,1085 ****
--- 1082,1093 ----
  		extern char Arpa_Usrerr[];
  
  		Errors++;
+ #ifdef	NAMED_BIND
  		if (stat == EX_NOHOST && h_errno != 0)
  			usrerr("%s (%s)", statmsg,
  				H_Errmsg[h_errno > MAXH_ERR ? 0 : h_errno]);
  		else
+ #endif	NAMED_BIND
  			usrerr(statmsg);
  	}
  
***************
*** 1102,1108 ****
--- 1110,1118 ----
  		e->e_message = newstr(&statmsg[4]);
  	}
  	errno = 0;
+ #ifdef	NAMED_BIND
  	h_errno = 0;
+ #endif	NAMED_BIND
  }
  /*
  **  LOGDELIVERY -- log the delivery in the system log

Rob
-- 
UUCP:   ...!mcvax!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             ARPA:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England