From 484b7007513543f58241aae6542ad1ea3d016871 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sat, 14 Jan 2017 10:20:38 +0000 Subject: [PATCH] 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 --- usr.sbin/inetd/inetd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index e538b871172a..e073f8f9c0ac 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -138,7 +138,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef LIBWRAP #include +#endif #include #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)