Fix up r312105

- Only #include tcpd.h when LIBWRAP is true to avoid header include errors
- Only define whichaf when LIBWRAP is true to avoid -Wunused warning and
  to avoid issues with structs being defined that should only be defined
  when tcpd.h is included.

MFC after:	2 weeks
X-MFC with:	r312105
Pointyhat to:	ngie
Reported by:	gcc tinderbox
Sponsored by:	Dell EMC Isilon
This commit is contained in:
Enji Cooper 2017-01-14 10:20:38 +00:00
parent 28699efd43
commit 484b700751
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312162

View File

@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <sysexits.h>
#include <syslog.h>
#ifdef LIBWRAP
#include <tcpd.h>
#endif
#include <unistd.h>
#include "inetd.h"
@ -307,6 +309,7 @@ getvalue(const char *arg, int *value, const char *whine)
return 0; /* success */
}
#ifdef LIBWRAP
static sa_family_t
whichaf(struct request_info *req)
{
@ -322,6 +325,7 @@ whichaf(struct request_info *req)
#endif
return sa->sa_family;
}
#endif
int
main(int argc, char **argv)