From 83741aca7a9a892b191701065cdc952a3c43f8cd Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Sun, 20 Mar 2016 23:48:31 +1100 Subject: [PATCH] Add configure check for Some systems need for the SIOCGIFCONF ioctl - this switches to using a proper configure check for that header rather than just assuming it'll be there if we can't find SIOCGIFCONF. Should be more robust. --- Changelog | 2 ++ configure | 3 ++- configure.in | 2 +- include/defs.h.in | 3 +++ source/commands.c | 5 ++--- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Changelog b/Changelog index d82020b..8542a68 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,7 @@ [Changes 1.2.2] +* Add configure check for . (caf) + * Improve /WINDOW DESCRIBE output a little. (caf) * If we can't create a socket for the first address returned by getaddrinfo(), diff --git a/configure b/configure index 927c15e..d435491 100755 --- a/configure +++ b/configure @@ -3979,7 +3979,8 @@ done -for ac_header in sys/socket.h sys/time.h sys/fcntl.h fcntl.h sys/file.h netinet/in.h netdb.h sys/un.h sys/filio.h regex.h arpa/nameser.h dirent.h sys/ndir.h sys/dir.h ndir.h termios.h + +for ac_header in sys/socket.h sys/sockio.h sys/time.h sys/fcntl.h fcntl.h sys/file.h netinet/in.h netdb.h sys/un.h sys/filio.h regex.h arpa/nameser.h dirent.h sys/ndir.h sys/dir.h ndir.h termios.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/configure.in b/configure.in index 57ad3d5..63d133f 100644 --- a/configure.in +++ b/configure.in @@ -56,7 +56,7 @@ AC_CHECK_LIB(m, pow, LIBS="-lm $LIBS",) dnl Checks for header files. AC_HEADER_DIRENT -AC_CHECK_HEADERS([sys/socket.h sys/time.h sys/fcntl.h fcntl.h sys/file.h netinet/in.h netdb.h sys/un.h sys/filio.h regex.h arpa/nameser.h dirent.h sys/ndir.h sys/dir.h ndir.h termios.h]) +AC_CHECK_HEADERS([sys/socket.h sys/sockio.h sys/time.h sys/fcntl.h fcntl.h sys/file.h netinet/in.h netdb.h sys/un.h sys/filio.h regex.h arpa/nameser.h dirent.h sys/ndir.h sys/dir.h ndir.h termios.h]) AC_CHECK_HEADERS([net/if.h], [], [], [AC_INCLUDES_DEFAULT diff --git a/include/defs.h.in b/include/defs.h.in index 72f9674..189633b 100644 --- a/include/defs.h.in +++ b/include/defs.h.in @@ -279,6 +279,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOUNDCARD_H diff --git a/source/commands.c b/source/commands.c index cfe37d3..6875f00 100644 --- a/source/commands.c +++ b/source/commands.c @@ -24,11 +24,10 @@ CVS_REVISION(commands_c) #else /* IPV6 */ #include -#include -#ifndef SIOCGIFCONF +#ifdef HAVE_SYS_SOCKIO_H #include -#endif /* SIOCGIFCONF */ +#endif /* HAVE_SYS_SOCKIO_H */ /* Some systems call it SIOCGIFCONF, some call it OSIOCGIFCONF */ #if defined(OSIOCGIFCONF)