Message ID | 20190726182524.43149-2-raj.khem@gmail.com |
---|---|
State | New |
Headers | show |
Series | [1/2] Add configure time check for getdents/getdents64 APIs | expand |
Hi Khem, > glibc 2.30 has remove RES_USE_INET6 define which has been on its way out > since 2.26 release, this check ensures that we detect it before using it Thank you for your patch. Good point, but mc_gethost.c was actually unused, so I removed it in 5a07ccea5. There is no other RES_USE_INET6 use (otherwise I'd be for removing it) therefore autotools checks aren't needed. Kind regards, Petr -- Mailing list info: https://lists.linux.it/listinfo/ltp
diff --git a/configure.ac b/configure.ac index 2255b5c181..ed7acccb01 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,19 @@ AC_CHECK_FUNCS([ \ vmsplice \ ]) +#check defines +AC_MSG_CHECKING([for RES_USE_INET6]) +AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include <resolv.h>]], + [[char dummy[RES_USE_INET6];]])], + [ + AC_MSG_RESULT([yes]) + AC_DEFINE_UNQUOTED([HAVE_RES_USE_INET6], 1, [Define to 1 if you have the RES_USE_INET6 macro.]) + ], + [ + AC_MSG_RESULT([no]) + AC_DEFINE_UNQUOTED([HAVE_RES_USE_INET6], 0, [Define to 1 if you have the RES_USE_INET6 macro.]) + ] +) # Tools knobs # Expect diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c index 9cc15d086b..d1cae5441a 100644 --- a/testcases/network/multicast/mc_gethost/mc_gethost.c +++ b/testcases/network/multicast/mc_gethost/mc_gethost.c @@ -17,6 +17,8 @@ #include <string.h> #include <stdlib.h> +#include "config.h" + #ifndef LOG_PERROR #define LOG_PERROR 0 #endif @@ -50,8 +52,12 @@ usage: argv++, argc--; } if (argc >= 1 && !strcmp(*argv, "-6")) { +#if HAVE_RES_USE_INET6 af = AF_INET6, size = IN6ADDRSZ; _res.options |= RES_USE_INET6; +#else + af = AF_INET, size = INADDRSZ; +#endif argv++, argc--; } if (argc >= 1 && !strcmp(*argv, "-f")) {
glibc 2.30 has remove RES_USE_INET6 define which has been on its way out since 2.26 release, this check ensures that we detect it before using it Signed-off-by: Khem Raj <raj.khem@gmail.com> --- configure.ac | 13 +++++++++++++ testcases/network/multicast/mc_gethost/mc_gethost.c | 6 ++++++ 2 files changed, 19 insertions(+) -- 2.22.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp