From: Ken Raeburn Date: Sat, 31 Aug 1996 06:11:43 +0000 (+0000) Subject: * pmap_rmt.c (getbroadcastnets): Tweak conditional layout to make emacs X-Git-Tag: krb5-1.0-beta7~69 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=be76f0c2ef42620a1d9d61a214a487973a8c5ff8;p=krb5.git * pmap_rmt.c (getbroadcastnets): Tweak conditional layout to make emacs indentation code happier. * netdb.h: Comment fix. * configure.in, getrpcent.c: Use configure to the return types of setrpcent() and getrpcent(). Also, check for struct rpcent in the system , and only define the structure in rpc/netdb.h if it's not in the system file. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9019 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 3add15aaf..e23c9b000 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,17 @@ +Sat Aug 31 01:46:45 1996 Ken Raeburn + + * pmap_rmt.c (getbroadcastnets): Tweak conditional layout to make + emacs indentation code happier. + + * netdb.h: Comment fix. + + Tue Aug 6 18:52:47 1996 Marc Horowitz + + * configure.in, getrpcent.c: Use configure to the return types of + setrpcent() and getrpcent(). Also, check for struct rpcent in the + system , and only define the structure in rpc/netdb.h if + it's not in the system file. + Tue Aug 13 15:18:16 1996 Tom Yu * getrpcent.c: Add PROTOTYPE and conditionalize function diff --git a/src/lib/rpc/configure.in b/src/lib/rpc/configure.in index 7fe2f069a..fede09104 100644 --- a/src/lib/rpc/configure.in +++ b/src/lib/rpc/configure.in @@ -43,6 +43,28 @@ AC_CHECK_SIZEOF(long) SIZEOF_LONG=$ac_cv_sizeof_long AC_SUBST(SIZEOF_LONG) +AC_MSG_CHECKING([return type of setrpcent]) +AC_CACHE_VAL(k5_cv_type_setrpcent, +[AC_TRY_COMPILE([#include +#ifdef __cplusplus +extern "C" +#endif +extern void setrpcent();], +[int i;], k5_cv_type_setrpcent=void, k5_cv_type_setrpcent=int)])dnl +AC_MSG_RESULT($k5_cv_type_setrpcent) +AC_DEFINE_UNQUOTED(SETRPCENT_TYPE, $k5_cv_type_setrpcent) +dnl +AC_MSG_CHECKING([return type of endrpcent]) +AC_CACHE_VAL(k5_cv_type_endrpcent, +[AC_TRY_COMPILE([#include +#ifdef __cplusplus +extern "C" +#endif +extern void endrpcent();], +[int i;], k5_cv_type_endrpcent=void, k5_cv_type_endrpcent=int)])dnl +AC_MSG_RESULT($k5_cv_type_endrpcent) +AC_DEFINE_UNQUOTED(ENDRPCENT_TYPE, $k5_cv_type_endrpcent) + DECLARE_SYS_ERRLIST V5_SHARED_LIB_OBJS diff --git a/src/lib/rpc/getrpcent.c b/src/lib/rpc/getrpcent.c index d30f276f3..506ebce90 100644 --- a/src/lib/rpc/getrpcent.c +++ b/src/lib/rpc/getrpcent.c @@ -43,21 +43,6 @@ static char sccsid[] = "@(#)getrpcent.c 1.9 87/08/11 Copyr 1984 Sun Micro"; #include #include -/* setrpcent is declared as int-returning in netdb.h on hpux */ -/* setrpcent is declared as int-returning in rpc/rpcent.h on Solaris */ -#if !defined(hpux) && !(defined(sun) && defined(__svr4__)) -#define SETRPCENT_TYPE void -#else -#define SETRPCENT_TYPE int -#endif - -/* endrpcent is declared as int-returning in netdb.h on hpux */ -#ifndef hpux -#define ENDRPCENT_TYPE void -#else -#define ENDRPCENT_TYPE int -#endif - /* * Make sure we have a definition for PROTOTYPE. */ diff --git a/src/lib/rpc/netdb.h b/src/lib/rpc/netdb.h index 60f5fab54..cbc5fb1d0 100644 --- a/src/lib/rpc/netdb.h +++ b/src/lib/rpc/netdb.h @@ -44,7 +44,8 @@ struct rpcent { char **r_aliases; /* alias list */ int r_number; /* rpc program number */ }; -#endif /*STRUCT_RPCENT_ALREADY_PROVIDED*/ +#endif /*STRUCT_RPCENT_IN_RPC_NETDB_H*/ + struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent(); #endif diff --git a/src/lib/rpc/pmap_rmt.c b/src/lib/rpc/pmap_rmt.c index 743d7fc30..9dd922c8f 100644 --- a/src/lib/rpc/pmap_rmt.c +++ b/src/lib/rpc/pmap_rmt.c @@ -199,10 +199,11 @@ getbroadcastnets(addrs, sock, buf) #if 0 /* this is uuuuugly */ addrs[i++] = inet_makeaddr(inet_netof #if defined(hpux) || (defined(sparc) && defined(__svr4__)) || defined(linux) || (defined(__osf__) && defined(__alpha__)) - (sin->sin_addr), INADDR_ANY); + (sin->sin_addr), #else /* hpux or solaris */ - (sin->sin_addr.s_addr), INADDR_ANY); + (sin->sin_addr.s_addr), #endif + INADDR_ANY); #endif } else { addrs[i++] = ((struct sockaddr_in*)