From 2da0b7dfbd02fab454b8ba60f1fdb7e2a5cbd2db Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 20 Jul 2001 11:06:05 +0000 Subject: [PATCH] 942. [port] libbind: GETNETBYADDR_ADDR_T was not correctly defined on some platforms. --- CHANGES | 3 ++ lib/bind/configure.in | 101 +++++++++++++++++++++++++++++++------- lib/bind/port_before.h.in | 1 + 3 files changed, 88 insertions(+), 17 deletions(-) diff --git a/CHANGES b/CHANGES index dcacb355f3..6a3975c9dc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ + 942. [port] libbind: GETNETBYADDR_ADDR_T was not correctly + defined on some platforms. + 941. [bug] The configuration checker crashed if a slave zone didn't contain a masters statement. [RT #1514] diff --git a/lib/bind/configure.in b/lib/bind/configure.in index 928745f3fd..48ab31732d 100644 --- a/lib/bind/configure.in +++ b/lib/bind/configure.in @@ -18,7 +18,7 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl esyscmd([sed "s/^/# /" COPYRIGHT])dnl AC_DIVERT_POP()dnl -AC_REVISION($Revision: 1.76 $) +AC_REVISION($Revision: 1.77 $) AC_INIT(resolv/herror.c) AC_PREREQ(2.13) @@ -1162,22 +1162,6 @@ AC_TRY_COMPILE([ ISC_LWRES_ENDHOSTENTINT="#undef ISC_LWRES_ENDHOSTENTINT"]) AC_SUBST(ISC_LWRES_ENDHOSTENTINT) -case "$host" in -*-solaris2.8*) - GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long";; -*) -AC_MSG_CHECKING(for getnetbyaddr(in_addr_t, ...)) -AC_TRY_COMPILE([ -#include -struct netent *getnetbyaddr(in_addr_t, int);], -[], - [AC_MSG_RESULT(yes) - GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T in_addr_t"], - [AC_MSG_RESULT(no) - GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long"]) -esac -AC_SUBST(GETNETBYADDR_ADDR_T) - AC_MSG_CHECKING(for int setnetent) AC_TRY_COMPILE([ #include ], @@ -1377,6 +1361,8 @@ NET_R_COPY_ARGS="#define NET_R_COPY_ARGS NET_R_ARGS" NET_R_OK="#define NET_R_OK nptr" NET_R_SETANSWER="#undef NET_R_SETANSWER" NET_R_RETURN="#define NET_R_RETURN struct netent *" +GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long" +NETENT_DATA="#undef NETENT_DATA" ], AC_TRY_COMPILE( [#include @@ -1392,7 +1378,44 @@ NET_R_COPY_ARGS="#define NET_R_COPY_ARGS char *buf, size_t buflen" NET_R_OK="#define NET_R_OK 0" NET_R_SETANSWER="#define NET_R_SETANSWER 1" NET_R_RETURN="#define NET_R_RETURN int" +GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T unsigned long int" +NETENT_DATA="#undef NETENT_DATA" ], +AC_TRY_COMPILE( +[#define _REENTRANT +#include +int getnetbyaddr_r(int, int, struct netent *, struct netent_data *); +], +[return (0)], +[ +NET_R_ARGS="#define NET_R_ARGS struct netent_data *ndptr" +NET_R_BAD="#define NET_R_BAD (-1)" +NET_R_COPY="#define NET_R_COPY ndptr" +NET_R_COPY_ARGS="#define NET_R_COPY_ARGS struct netent_data *ndptr" +NET_R_OK="#define NET_R_OK 0" +NET_R_SETANSWER="#undef NET_R_SETANSWER" +NET_R_RETURN="#define NET_R_RETURN int" +GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T int" +NETENT_DATA="#define NETENT_DATA 1" +], +AC_TRY_COMPILE( +[#include +int getnetbyaddr_r (long, int, struct netent *, struct netent_data *); +], +[return (0)], +[ +NET_R_ARGS="#define NET_R_ARGS struct netent_data *ndptr" +NET_R_BAD="#define NET_R_BAD (-1)" +NET_R_COPY="#define NET_R_COPY ndptr" +NET_R_COPY_ARGS="#define NET_R_COPY_ARGS struct netent_data *ndptr" +NET_R_OK="#define NET_R_OK 0" +NET_R_SETANSWER="#undef NET_R_SETANSWER" +NET_R_RETURN="#define NET_R_RETURN int" +GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long" +NETENT_DATA="#define NETENT_DATA 1" +], +) +) ) ) , @@ -1403,6 +1426,8 @@ NET_R_COPY_ARGS="#define NET_R_COPY_ARGS NET_R_ARGS" NET_R_OK="#define NET_R_OK nptr" NET_R_SETANSWER="#undef NET_R_SETANSWER" NET_R_RETURN="#define NET_R_RETURN struct netent *" +GETNETBYADDR_ADDR_T="#define GETNETBYADDR_ADDR_T long" +NETENT_DATA="#undef NETENT_DATA" ) AC_SUBST(NET_R_ARGS) AC_SUBST(NET_R_BAD) @@ -1411,8 +1436,31 @@ AC_SUBST(NET_R_COPY_ARGS) AC_SUBST(NET_R_OK) AC_SUBST(NET_R_SETANSWER) AC_SUBST(NET_R_RETURN) +AC_SUBST(GETNETBYADDR_ADDR_T) +AC_SUBST(NETENT_DATA) AC_CHECK_FUNC(setnetent_r, +AC_TRY_COMPILE( +[ +#include +void setnetent_r (int); +] ,[return (0);],[ +NET_R_ENT_ARGS="#undef NET_R_ENT_ARGS /*empty*/" +NET_R_SET_RESULT="#undef NET_R_SET_RESULT /*empty*/" +NET_R_SET_RETURN="#define NET_R_SET_RETURN void" +], +AC_TRY_COMPILE( +[ +#define _REENTRANT +#include +extern int setnetent_r(int, struct netent_data *); +] ,[return (0);],[ +NET_R_ENT_ARGS="#define NET_R_ENT_ARGS struct netent_data *ndptr" +NET_R_SET_RESULT="#define NET_R_SET_RESULT NET_R_OK" +NET_R_SET_RETURN="#define NET_R_SET_RETURN int" +], +) +) , NET_R_ENT_ARGS="#undef NET_R_ENT_ARGS /*empty*/" NET_R_SET_RESULT="#undef NET_R_SET_RESULT /*empty*/" @@ -1423,6 +1471,25 @@ AC_SUBST(NET_R_SET_RESULT) AC_SUBST(NET_R_SET_RETURN) AC_CHECK_FUNC(endnetent_r, +AC_TRY_COMPILE( +[ +#include +void endnetent_r (void); +] ,[return (0);],[ +NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/" +NET_R_END_RETURN="#define NET_R_END_RETURN void" +], +AC_TRY_COMPILE( +[ +#define _REENTRANT +#include +extern int endnetent_r(struct netent_data *); +] ,[return (0);],[ +NET_R_END_RESULT="#define NET_R_END_RESULT(x) return (x)" +NET_R_END_RETURN="#define NET_R_END_RETURN int" +], +) +) , NET_R_END_RESULT="#define NET_R_END_RESULT(x) /*empty*/" NET_R_END_RETURN="#define NET_R_END_RETURN void" diff --git a/lib/bind/port_before.h.in b/lib/bind/port_before.h.in index db8810d64c..cbb4d7f55a 100644 --- a/lib/bind/port_before.h.in +++ b/lib/bind/port_before.h.in @@ -37,6 +37,7 @@ struct timezone; /* silence warning */ @NET_R_SET_RESULT@ @NET_R_SETANSWER@ @NET_R_SET_RETURN@ +@NETENT_DATA@ @GROUP_R_RETURN@ @GROUP_R_SET_RETURN@