summary refs log tree commit diff
path: root/sunrpc
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2010-09-01 04:12:55 -0700
committerUlrich Drepper <drepper@redhat.com>2010-09-01 04:12:55 -0700
commit2f3e3dc75f36367b71873eb6dda62effa5f9cd6d (patch)
treef06e6c8db8f368b981b2e4cf2662e07f55337d74 /sunrpc
parentf3dcc2f9a52e46ecf1e7df18863e1ffea62ba37d (diff)
downloadglibc-2f3e3dc75f36367b71873eb6dda62effa5f9cd6d.tar.gz
glibc-2f3e3dc75f36367b71873eb6dda62effa5f9cd6d.tar.xz
glibc-2f3e3dc75f36367b71873eb6dda62effa5f9cd6d.zip
Remove duplicate version of pmap_getport from NIS code.
Diffstat (limited to 'sunrpc')
-rw-r--r--sunrpc/Versions2
-rw-r--r--sunrpc/pm_getport.c32
2 files changed, 27 insertions, 7 deletions
diff --git a/sunrpc/Versions b/sunrpc/Versions
index d2d8e81ac0..a11dd8d36c 100644
--- a/sunrpc/Versions
+++ b/sunrpc/Versions
@@ -117,6 +117,6 @@ libc {
     xdr_quad_t; xdr_u_quad_t;
   }
   GLIBC_PRIVATE {
-    __libc_clntudp_bufcreate;
+    __libc_clntudp_bufcreate; __libc_rpc_getport;
   }
 }
diff --git a/sunrpc/pm_getport.c b/sunrpc/pm_getport.c
index 66340c0a52..da3477603e 100644
--- a/sunrpc/pm_getport.c
+++ b/sunrpc/pm_getport.c
@@ -39,11 +39,6 @@
 #include <rpc/pmap_clnt.h>
 #include <sys/socket.h>
 
-static const struct timeval timeout =
-{5, 0};
-static const struct timeval tottimeout =
-{60, 0};
-
 /*
  * Create a socket that is locally bound to a non-reserve port. For
  * any failures, -1 is returned which will cause the RPC code to
@@ -81,16 +76,24 @@ __get_socket (struct sockaddr_in *saddr)
 
 /*
  * Find the mapped port for program,version.
+ * Internal version with additional parameters.
  * Calls the pmap service remotely to do the lookup.
  * Returns 0 if no map exists.
  */
 u_short
-pmap_getport (address, program, version, protocol)
+internal_function
+__libc_rpc_getport (address, program, version, protocol, timeout_sec,
+		    tottimeout_sec)
      struct sockaddr_in *address;
      u_long program;
      u_long version;
      u_int protocol;
+     time_t timeout_sec;
+     time_t tottimeout_sec;
 {
+  const struct timeval timeout = {timeout_sec, 0};
+  const struct timeval tottimeout = {tottimeout_sec, 0};
+
   u_short port = 0;
   int socket = -1;
   CLIENT *client;
@@ -137,4 +140,21 @@ pmap_getport (address, program, version, protocol)
   address->sin_port = 0;
   return port;
 }
+libc_hidden_def (__libc_rpc_getport)
+
+
+/*
+ * Find the mapped port for program,version.
+ * Calls the pmap service remotely to do the lookup.
+ * Returns 0 if no map exists.
+ */
+u_short
+pmap_getport (address, program, version, protocol)
+     struct sockaddr_in *address;
+     u_long program;
+     u_long version;
+     u_int protocol;
+{
+  return __libc_rpc_getport (address, program, version, protocol, 5, 60);
+}
 libc_hidden_def (pmap_getport)