From 4014bc42dd587bf2b9ce8fd595ec28bccad7aa5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 4 Sep 2018 12:42:48 +0200 Subject: [PATCH] According to POSIX.1-2001, POSIX.1-2008 #include is correct way to get fd_set --- bin/tests/optional/zone_test.c | 5 +-- configure | 53 ------------------------------- configure.in | 36 --------------------- lib/isc/include/isc/platform.h.in | 11 ++++--- lib/isc/unix/socket_p.h | 4 +-- 5 files changed, 8 insertions(+), 101 deletions(-) diff --git a/bin/tests/optional/zone_test.c b/bin/tests/optional/zone_test.c index d64bd189ae..b26acea0b1 100644 --- a/bin/tests/optional/zone_test.c +++ b/bin/tests/optional/zone_test.c @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -35,10 +36,6 @@ #include #include -#ifdef ISC_PLATFORM_NEEDSYSSELECTH -#include -#endif - static int debug = 0; static int quiet = 0; static int stats = 0; diff --git a/configure b/configure index cbf970700b..8d44145be1 100755 --- a/configure +++ b/configure @@ -765,7 +765,6 @@ ax_pthread_config CHECK_DSA GEOIPLINKOBJS GEOIPLINKSRCS -ISC_PLATFORM_NEEDSYSSELECTH ISC_PLATFORM_HAVEDEVPOLL ISC_PLATFORM_HAVEEPOLL ISC_PLATFORM_HAVEKQUEUE @@ -14003,58 +14002,6 @@ done esac -# -# check if we need to #include sys/select.h explicitly -# -case $ac_cv_header_unistd_h in -yes) -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if unistd.h or sys/types.h defines fd_set" >&5 -$as_echo_n "checking if unistd.h or sys/types.h defines fd_set... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include /* Ultrix */ -#include -int -main () -{ -fd_set read_set; return (0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - case $ac_cv_header_sys_select_h in - yes) - ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" - ;; - no) - as_fn_error $? "need either working unistd.h or sys/select.h" "$LINENO" 5 - ;; - esac - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; -no) - case $ac_cv_header_sys_select_h in - yes) - ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" - ;; - no) - as_fn_error $? "need either unistd.h or sys/select.h" "$LINENO" 5 - ;; - esac - ;; -esac - - # # Find the machine's endian flavor. # diff --git a/configure.in b/configure.in index 04f51bc77f..5de4a1e300 100644 --- a/configure.in +++ b/configure.in @@ -609,42 +609,6 @@ yes) esac AC_SUBST(ISC_PLATFORM_HAVEDEVPOLL) -# -# check if we need to #include sys/select.h explicitly -# -case $ac_cv_header_unistd_h in -yes) -AC_MSG_CHECKING(if unistd.h or sys/types.h defines fd_set) -AC_TRY_COMPILE([ -#include /* Ultrix */ -#include ], -[fd_set read_set; return (0);], - [AC_MSG_RESULT(yes) - ISC_PLATFORM_NEEDSYSSELECTH="#undef ISC_PLATFORM_NEEDSYSSELECTH"], - [AC_MSG_RESULT(no) - case $ac_cv_header_sys_select_h in - yes) - ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" - ;; - no) - AC_MSG_ERROR([need either working unistd.h or sys/select.h]) - ;; - esac - ]) - ;; -no) - case $ac_cv_header_sys_select_h in - yes) - ISC_PLATFORM_NEEDSYSSELECTH="#define ISC_PLATFORM_NEEDSYSSELECTH 1" - ;; - no) - AC_MSG_ERROR([need either unistd.h or sys/select.h]) - ;; - esac - ;; -esac -AC_SUBST(ISC_PLATFORM_NEEDSYSSELECTH) - # # Find the machine's endian flavor. # diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in index 13e138e6e1..ee6b87adb6 100644 --- a/lib/isc/include/isc/platform.h.in +++ b/lib/isc/include/isc/platform.h.in @@ -36,6 +36,12 @@ *** Network. ***/ +/*! \brief + * Define if the system has struct lifconf which is a extended struct ifconf + * for IPv6. + */ +@ISC_PLATFORM_HAVELIFCONF@ + /*! \brief * Define if the system has TCP_FASTOPEN socket option. */ @@ -69,11 +75,6 @@ *** Miscellaneous. ***/ -/* - * Defined if unistd.h does not cause fd_set to be delared. - */ -@ISC_PLATFORM_NEEDSYSSELECTH@ - /* * Defined to or for how to include * the GSSAPI header. diff --git a/lib/isc/unix/socket_p.h b/lib/isc/unix/socket_p.h index fb4fdb89d7..6ab124d054 100644 --- a/lib/isc/unix/socket_p.h +++ b/lib/isc/unix/socket_p.h @@ -15,9 +15,7 @@ /*! \file */ -#ifdef ISC_PLATFORM_NEEDSYSSELECTH -#include -#endif +#include typedef struct isc_socketwait isc_socketwait_t; int isc__socketmgr_waitevents(isc_socketmgr_t *, struct timeval *,