Commit 393e4679 authored by Mark Andrews's avatar Mark Andrews
Browse files

2064. [bug] libbind: silence AIX compiler warnings. [RT #16218]

parent 854dac0f
2064. [bug] libbind: silence AIX compiler warnings. [RT #16218]
2063. [bug] Change #1955 introduced a bug which caused the first
'rndc flush' call to not free memory. [RT #16244]
......
This diff is collapsed.
......@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
AC_REVISION($Revision: 1.119 $)
AC_REVISION($Revision: 1.120 $)
AC_INIT(resolv/herror.c)
AC_PREREQ(2.13)
......@@ -1399,6 +1399,24 @@ AC_TRY_COMPILE(
#undef __USE_MISC
#define __USE_MISC
[#include <netdb.h>
int getnetbyaddr_r (in_addr_t, 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"
],
AC_TRY_COMPILE(
#undef __USE_MISC
#define __USE_MISC
[#include <netdb.h>
int getnetbyaddr_r (long, int, struct netent *, struct netent_data *);
],
[return (0)],
......@@ -1437,6 +1455,7 @@ NETENT_DATA="#undef NETENT_DATA"
)
)
)
)
,
NET_R_ARGS="#define NET_R_ARGS char *buf, int buflen"
NET_R_BAD="#define NET_R_BAD NULL"
......@@ -1903,9 +1922,28 @@ AC_SUBST(NGR_R_RETURN)
AC_SUBST(NGR_R_PRIVATE)
AC_CHECK_FUNC(endnetgrent_r,
AC_TRY_COMPILE(
[
#undef __USE_MISC
#define __USE_MISC
#include <netdb.h>
void endnetgrent_r(void **ptr);
]
,
[return (0);]
,
[
NGR_R_END_RESULT="#define NGR_R_END_RESULT(x) /* empty */"
NGR_R_END_RETURN="#define NGR_R_END_RETURN void"
NGR_R_ENT_ARGS="#define NGR_R_ENT_ARGS NGR_R_ARGS"
]
,
[
NGR_R_END_RESULT="#define NGR_R_END_RESULT(x) return (x)"
NGR_R_END_RETURN="#define NGR_R_END_RETURN int"
NGR_R_ENT_ARGS="#define NGR_R_ENT_ARGS NGR_R_ARGS"
]
)
,
NGR_R_END_RESULT="#define NGR_R_END_RESULT(x) /*empty*/"
NGR_R_END_RETURN="#define NGR_R_END_RETURN void"
......@@ -1962,6 +2000,7 @@ PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS PROTO_R_ARGS"
PROTO_R_OK="#define PROTO_R_OK pptr"
PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
PROTO_R_RETURN="#define PROTO_R_RETURN struct protoent *"
PROTOENT_DATA="#undef PROTOENT_DATA"
]
,
AC_TRY_COMPILE(
......@@ -1983,10 +2022,34 @@ PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS char *buf, size_t buflen"
PROTO_R_OK="#define PROTO_R_OK 0"
PROTO_R_SETANSWER="#define PROTO_R_SETANSWER 1"
PROTO_R_RETURN="#define PROTO_R_RETURN int"
PROTOENT_DATA="#undef PROTOENT_DATA"
]
,
AC_TRY_COMPILE(
[
#undef __USE_MISC
#define __USE_MISC
#include <netdb.h>
int getprotoent_r (struct protoent *, struct protoent_data *prot_data);
]
,
[return (0);]
,
[
PROTO_R_ARGS="#define PROTO_R_ARGS struct protoent_data *prot_data"
PROTO_R_BAD="#define PROTO_R_BAD (-1)"
PROTO_R_COPY="#define PROTO_R_COPY prot_data"
PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS struct protoent_data *pdptr"
PROTO_R_OK="#define PROTO_R_OK 0"
PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
PROTO_R_RETURN="#define PROTO_R_RETURN int"
PROTOENT_DATA="#define PROTOENT_DATA 1"
]
,
)
)
)
,
PROTO_R_ARGS="#define PROTO_R_ARGS char *buf, int buflen"
PROTO_R_BAD="#define PROTO_R_BAD NULL"
......@@ -1995,7 +2058,9 @@ PROTO_R_COPY_ARGS="#define PROTO_R_COPY_ARGS PROTO_R_ARGS"
PROTO_R_OK="#define PROTO_R_OK pptr"
PROTO_R_SETANSWER="#undef PROTO_R_SETANSWER"
PROTO_R_RETURN="#define PROTO_R_RETURN struct protoent *"
PROTOENT_DATA="#undef PROTOENT_DATA"
)
;;
esac
AC_SUBST(PROTO_R_ARGS)
AC_SUBST(PROTO_R_BAD)
......@@ -2004,6 +2069,7 @@ AC_SUBST(PROTO_R_COPY_ARGS)
AC_SUBST(PROTO_R_OK)
AC_SUBST(PROTO_R_SETANSWER)
AC_SUBST(PROTO_R_RETURN)
AC_SUBST(PROTOENT_DATA)
case $host in
ia64-hp-hpux11.*)
......@@ -2024,18 +2090,39 @@ void endprotoent_r(void);
PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
PROTO_R_ENT_ARGS="#undef PROTO_R_ENT_ARGS"
PROTO_R_ENT_UNUSED="#undef PROTO_R_ENT_UNUSED"
]
,
AC_TRY_COMPILE(
[
#undef _REENTRANT
#define _REENTRANT
#undef __USE_MISC
#define __USE_MISC
#include <netdb.h>
void endprotoent_r(struct protoent_data *);
]
,,
[
PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
PROTO_R_ENT_ARGS="#define PROTO_R_ENT_ARGS struct protoent_data *proto_data"
PROTO_R_ENT_UNUSED="#define PROTO_R_ENT_UNUSED UNUSED(proto_data)"
]
,
)
)
,
PROTO_R_END_RESULT="#define PROTO_R_END_RESULT(x) /*empty*/"
PROTO_R_END_RETURN="#define PROTO_R_END_RETURN void"
PROTO_R_ENT_ARGS="#undef PROTO_R_ENT_ARGS /*empty*/"
PROTO_R_ENT_UNUSED="#undef PROTO_R_ENT_UNUSED"
)
esac
AC_SUBST(PROTO_R_END_RESULT)
AC_SUBST(PROTO_R_END_RETURN)
AC_SUBST(PROTO_R_ENT_ARGS)
AC_SUBST(PROTO_R_ENT_UNUSED)
case $host in
ia64-hp-hpux11.*)
......@@ -2054,6 +2141,19 @@ void setprotoent_r __P((int));
PROTO_R_SET_RESULT="#undef PROTO_R_SET_RESULT"
PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN void"
,
AC_TRY_COMPILE(
[
#undef _REENTRANT
#define _REENTRANT
#undef __USE_MISC
#define __USE_MISC
#include <netdb.h>
int setprotoent_r (int, struct protoent_data *);
],[],
PROTO_R_SET_RESULT="#define PROTO_R_SET_RESULT (0)"
PROTO_R_SET_RETURN="#define PROTO_R_SET_RETURN int"
,
)
)
,
PROTO_R_SET_RESULT="#undef PROTO_R_SET_RESULT"
......@@ -2188,6 +2288,25 @@ SERV_R_SETANSWER="#define SERV_R_SETANSWER 1"
SERV_R_RETURN="#define SERV_R_RETURN int"
]
,
AC_TRY_COMPILE([
#undef __USE_MISC
#define __USE_MISC
#include <netdb.h>
int
getservent_r (struct servent *, struct servent_data *serv_data);
],[return (0);],
[
SERV_R_ARGS="#define SERV_R_ARGS struct servent_data *serv_data"
SERV_R_BAD="#define SERV_R_BAD (-1)"
SERV_R_COPY="#define SERV_R_COPY serv_data"
SERV_R_COPY_ARGS="#define SERV_R_COPY_ARGS struct servent_data *sdptr"
SERV_R_OK="#define SERV_R_OK (0)"
SERV_R_SETANSWER="#undef SERV_R_SETANSWER"
SERV_R_RETURN="#define SERV_R_RETURN int"
SERVENT_DATA="#define SERVENT_DATA 1"
]
,
)
)
)
,
......@@ -2207,6 +2326,7 @@ AC_SUBST(SERV_R_COPY_ARGS)
AC_SUBST(SERV_R_OK)
AC_SUBST(SERV_R_SETANSWER)
AC_SUBST(SERV_R_RETURN)
AC_SUBST(SERVENT_DATA)
case $host in
ia64-hp-hpux11.*)
......@@ -2228,18 +2348,40 @@ void endservent_r(void);
SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
SERV_R_ENT_ARGS="#undef SERV_R_ENT_ARGS /*empty*/"
SERV_R_ENT_UNUSED="#undef SERV_R_ENT_UNUSED /*empty*/"
]
,
AC_TRY_COMPILE(
[
#undef _REENTRANT
#define _REENTRANT
#undef __USE_MISC
#define __USE_MISC
#include <netdb.h>
void endservent_r(struct servent_data *serv_data);
]
,
,
[
SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
SERV_R_ENT_ARGS="#define SERV_R_ENT_ARGS struct servent_data *serv_data"
SERV_R_ENT_UNUSED="#define SERV_R_ENT_UNUSED UNUSED(serv_data)"
]
,
)
)
,
SERV_R_END_RESULT="#define SERV_R_END_RESULT(x) /*empty*/"
SERV_R_END_RETURN="#define SERV_R_END_RETURN void "
SERV_R_ENT_ARGS="#undef SERV_R_ENT_ARGS /*empty*/"
SERV_R_ENT_UNUSED="#undef SERV_R_ENT_UNUSED /*empty*/"
)
esac
AC_SUBST(SERV_R_END_RESULT)
AC_SUBST(SERV_R_END_RETURN)
AC_SUBST(SERV_R_ENT_ARGS)
AC_SUBST(SERV_R_ENT_UNUSED)
case $host in
ia64-hp-hpux11.*)
......@@ -2253,7 +2395,7 @@ AC_TRY_COMPILE(
#undef __USE_MISC
#define __USE_MISC
#include <netdb.h>
void setservent_r(int);
void setservent_r(int);
]
,,
[
......@@ -2261,6 +2403,22 @@ SERV_R_SET_RESULT="#undef SERV_R_SET_RESULT"
SERV_R_SET_RETURN="#define SERV_R_SET_RETURN void"
]
,
AC_TRY_COMPILE(
[
#undef _REENTRANT
#define _REENTRANT
#undef __USE_MISC
#define __USE_MISC
#include <netdb.h>
int setservent_r(int, struct servent_data *);
]
,,
[
SERV_R_SET_RESULT="#define SERV_R_SET_RESULT (0)"
SERV_R_SET_RETURN="#define SERV_R_SET_RETURN int"
]
,
)
)
,
SERV_R_SET_RESULT="#undef SERV_R_SET_RESULT"
......
......@@ -86,7 +86,7 @@
/*
* @(#)netdb.h 8.1 (Berkeley) 6/2/93
* $Id: netdb.h,v 1.18 2006/03/06 02:22:36 marka Exp $
* $Id: netdb.h,v 1.19 2006/08/01 01:14:16 marka Exp $
*/
#ifndef _NETDB_H_
......@@ -290,7 +290,7 @@ struct hostent_data {
struct netent_data {
FILE *net_fp;
#ifdef __osf__
#if defined(__osf__) || defined(_AIX)
char line[_MAXLINELEN];
#endif
#ifdef __hpux
......@@ -307,10 +307,21 @@ struct netent_data {
char *current;
int currentlen;
#endif
#ifdef _AIX
int _net_stayopen;
char *current;
int currentlen;
void *_net_reserv1; /* reserved for future use */
void *_net_reserv2; /* reserved for future use */
#endif
};
struct protoent_data {
FILE *proto_fp;
#ifdef _AIX
int _proto_stayopen;
char line[_MAXLINELEN];
#endif
#ifdef __osf__
char line[1024];
#endif
......@@ -328,11 +339,17 @@ struct protoent_data {
char *current;
int currentlen;
#endif
#ifdef _AIX
int currentlen;
char *current;
void *_proto_reserv1; /* reserved for future use */
void *_proto_reserv2; /* reserved for future use */
#endif
};
struct servent_data {
FILE *serv_fp;
#ifdef __osf__
#if defined(__osf__) || defined(_AIX)
char line[_MAXLINELEN];
#endif
#ifdef __hpux
......@@ -349,6 +366,13 @@ struct servent_data {
char *current;
int currentlen;
#endif
#ifdef _AIX
int _serv_stayopen;
char *current;
int currentlen;
void *_serv_reserv1; /* reserved for future use */
void *_serv_reserv2; /* reserved for future use */
#endif
};
#endif
#endif
......@@ -456,6 +480,15 @@ int endservent_r __P((struct servent_data *));
#else
void endservent_r __P((struct servent_data *));
#endif
#ifdef _AIX
int setnetgrent_r __P((const char *, void **));
void endnetgrent_r __P((void **));
/*
* Note: AIX's netdb.h declares innetgr_r() as:
* int innetgr_r(char *, char *, char *, char *, struct innetgr_data *);
*/
int innetgr_r __P((const char *, const char *, const char *,
const char *));
#else
/* defined(sun) || defined(bsdi) */
#ifdef __GLIBC__
......@@ -526,8 +559,6 @@ void endservent_r __P((void));
#ifdef __GLIBC__
int getnetgrent_r __P((char **, char **, char **, char *, size_t));
#endif
#ifdef _AIX
int setnetgrent_r __P((char *, void **));
#endif
#endif
......
......@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$Id: getprotoent_r.c,v 1.5 2005/04/27 04:56:26 sra Exp $";
static const char rcsid[] = "$Id: getprotoent_r.c,v 1.6 2006/08/01 01:14:16 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <port_before.h>
......@@ -109,6 +109,9 @@ setprotoent_r(int stay_open, PROTO_R_ENT_ARGS)
setprotoent_r(int stay_open)
#endif
{
#ifdef PROTO_R_ENT_UNUSED
PROTO_R_ENT_UNUSED;
#endif
setprotoent(stay_open);
#ifdef PROTO_R_SET_RESULT
return (PROTO_R_SET_RESULT);
......@@ -122,6 +125,9 @@ endprotoent_r(PROTO_R_ENT_ARGS)
endprotoent_r()
#endif
{
#ifdef PROTO_R_ENT_UNUSED
PROTO_R_ENT_UNUSED;
#endif
endprotoent();
PROTO_R_END_RESULT(PROTO_R_OK);
}
......
......@@ -16,7 +16,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$Id: getservent_r.c,v 1.5 2005/04/27 04:56:27 sra Exp $";
static const char rcsid[] = "$Id: getservent_r.c,v 1.6 2006/08/01 01:14:16 marka Exp $";
#endif /* LIBC_SCCS and not lint */
#include <port_before.h>
......@@ -112,7 +112,9 @@ setservent_r(int stay_open, SERV_R_ENT_ARGS)
setservent_r(int stay_open)
#endif
{
#ifdef SERV_R_ENT_UNUSED
SERV_R_ENT_UNUSED;
#endif
setservent(stay_open);
#ifdef SERV_R_SET_RESULT
return (SERV_R_SET_RESULT);
......@@ -126,7 +128,9 @@ endservent_r(SERV_R_ENT_ARGS)
endservent_r()
#endif
{
#ifdef SERV_R_ENT_UNUSED
SERV_R_ENT_UNUSED;
#endif
endservent();
SERV_R_END_RESULT(SERV_R_OK);
}
......@@ -194,8 +198,8 @@ copy_servent(struct servent *se, struct servent *sptr, SERV_R_COPY_ARGS) {
sptr->s_port = se->s_port;
/* copy official name */
cp = ndptr->line;
eob = ndptr->line + sizeof(ndptr->line);
cp = sdptr->line;
eob = sdptr->line + sizeof(sdptr->line);
if ((n = strlen(se->s_name) + 1) < (eob - cp)) {
strcpy(cp, se->s_name);
sptr->s_name = cp;
......@@ -206,7 +210,7 @@ copy_servent(struct servent *se, struct servent *sptr, SERV_R_COPY_ARGS) {
/* copy aliases */
i = 0;
sptr->s_aliases = ndptr->serv_aliases;
sptr->s_aliases = sdptr->serv_aliases;
while (se->s_aliases[i] && i < (_MAXALIASES-1)) {
if ((n = strlen(se->s_aliases[i]) + 1) < (eob - cp)) {
strcpy(cp, se->s_aliases[i]);
......
......@@ -87,11 +87,13 @@ struct timezone; /* silence warning */
@PROTO_R_END_RESULT@
@PROTO_R_END_RETURN@
@PROTO_R_ENT_ARGS@
@PROTO_R_ENT_UNUSED@
@PROTO_R_OK@
@PROTO_R_SETANSWER@
@PROTO_R_RETURN@
@PROTO_R_SET_RESULT@
@PROTO_R_SET_RETURN@
@PROTOENT_DATA@
@PASS_R_ARGS@
@PASS_R_BAD@
......@@ -112,11 +114,13 @@ struct timezone; /* silence warning */
@SERV_R_END_RESULT@
@SERV_R_END_RETURN@
@SERV_R_ENT_ARGS@
@SERV_R_ENT_UNUSED@
@SERV_R_OK@
@SERV_R_SETANSWER@
@SERV_R_RETURN@
@SERV_R_SET_RESULT@
@SERV_R_SET_RETURN@
@SERVENT_DATA@
#define DE_CONST(konst, var) \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment