]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Handle systems with getrpcbynumber() but no header file for it.
authorGuy Harris <[email protected]>
Sat, 3 Sep 2011 04:31:09 +0000 (21:31 -0700)
committerGuy Harris <[email protected]>
Sat, 3 Sep 2011 04:31:44 +0000 (21:31 -0700)
Glibc 2.14 doesn't install the ONC RPC headers, but it installs the ONC
RPC routines, presumably for binary compatibility.  Don't use
getrpcbynumber() unless we have it *and* the header file to declare it.

config.h.in
configure
configure.in
print-sunrpc.c

index 5ecbd7dd00b090c21edf48daa1c32664fa6aa202..9ee068be14feb92586bd60569219fa6d4329b51d 100644 (file)
 /* Define to 1 if you have the <rpc/rpcent.h> header file. */
 #undef HAVE_RPC_RPCENT_H
 
+/* Define to 1 if you have the <rpc/rpc.h> header file. */
+#undef HAVE_RPC_RPC_H
+
 /* Define to 1 if you have the `setlinebuf' function. */
 #undef HAVE_SETLINEBUF
 
index fd0617b19ffea898cce61606e6dbd32a5a2a9cbd..f481d333d3f9fe5786962ab03d1e4d2353198c77 100755 (executable)
--- a/configure
+++ b/configure
@@ -3989,7 +3989,8 @@ done
 
 
 
-for ac_header in fcntl.h rpc/rpcent.h netdnet/dnetdb.h
+
+for ac_header in fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
index 96d89831e8547e3adf44d558d7562972d86e4909..4ac664ecf099508410469699d8c05ace4667e000 100644 (file)
@@ -29,7 +29,7 @@ AC_C___ATTRIBUTE__
 if test "$ac_cv___attribute__" = "yes"; then
        AC_C___ATTRIBUTE___FORMAT_FUNCTION_POINTER
 fi
-AC_CHECK_HEADERS(fcntl.h rpc/rpcent.h netdnet/dnetdb.h)
+AC_CHECK_HEADERS(fcntl.h rpc/rpc.h rpc/rpcent.h netdnet/dnetdb.h)
 AC_CHECK_HEADERS(net/pfvar.h, , , [#include <sys/types.h>
 #include <sys/socket.h>
 #include <net/if.h>])
index e33b7625e14e9e2a09fe5caface38035f1ad5eb3..21cd85a9c509fd079c652da49a7e1573ab8f8246 100644 (file)
@@ -45,12 +45,12 @@ static const char rcsid[] _U_ =
 
 #include <tcpdump-stdinc.h>
 
-#ifdef HAVE_GETRPCBYNUMBER
+#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
 #include <rpc/rpc.h>
 #ifdef HAVE_RPC_RPCENT_H
 #include <rpc/rpcent.h>
 #endif /* HAVE_RPC_RPCENT_H */
-#endif /* HAVE_GETRPCBYNUMBER */
+#endif /* defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H) */
 
 #include <stdio.h>
 #include <string.h>
@@ -151,7 +151,7 @@ static char *
 progstr(prog)
        u_int32_t prog;
 {
-#ifdef HAVE_GETRPCBYNUMBER
+#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
        register struct rpcent *rp;
 #endif
        static char buf[32];
@@ -159,12 +159,12 @@ progstr(prog)
 
        if (lastprog != 0 && prog == lastprog)
                return (buf);
-#ifdef HAVE_GETRPCBYNUMBER
+#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
        rp = getrpcbynumber(prog);
        if (rp == NULL)
 #endif
                (void) snprintf(buf, sizeof(buf), "#%u", prog);
-#ifdef HAVE_GETRPCBYNUMBER
+#if defined(HAVE_GETRPCBYNUMBER) && defined(HAVE_RPC_RPC_H)
        else
                strlcpy(buf, rp->r_name, sizeof(buf));
 #endif