summaryrefslogtreecommitdiffstats
path: root/cpukit/librpc/src/rpc/pmap_getport.c
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2010-05-27 07:36:24 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2010-05-27 07:36:24 +0000
commit1f5986bf651597e82ddc6941484606855b45be92 (patch)
tree8e81c748647120ae4280754b830a4aef7d37e489 /cpukit/librpc/src/rpc/pmap_getport.c
parent2010-05-27 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-1f5986bf651597e82ddc6941484606855b45be92.tar.bz2
2010-05-27 Ralf Corsépius <ralf.corsepius@rtems.org>
* librpc/include/rpc/clnt.h, librpc/include/rpc/rpc_msg.h, librpc/src/rpc/clnt_generic.c, librpc/src/rpc/clnt_raw.c, librpc/src/rpc/clnt_tcp.c, librpc/src/rpc/clnt_udp.c, librpc/src/rpc/pmap_clnt.c, librpc/src/rpc/pmap_getmaps.c librpc/src/rpc/pmap_getport.c: Partial merger from freebsd (portability fixes).
Diffstat (limited to '')
-rw-r--r--cpukit/librpc/src/rpc/pmap_getport.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/cpukit/librpc/src/rpc/pmap_getport.c b/cpukit/librpc/src/rpc/pmap_getport.c
index 405d5ec546..c75b4d5444 100644
--- a/cpukit/librpc/src/rpc/pmap_getport.c
+++ b/cpukit/librpc/src/rpc/pmap_getport.c
@@ -52,8 +52,8 @@ static char *rcsid = "$FreeBSD: src/lib/libc/rpc/pmap_getport.c,v 1.10 2000/01/2
#include <net/if.h>
#include <unistd.h>
-static struct timeval timeout = { 5, 0 };
-static struct timeval tottimeout = { 60, 0 };
+static const struct timeval timeout = { 5, 0 };
+static const struct timeval tottimeout = { 60, 0 };
/*
* Find the mapped port for program,version.
@@ -69,19 +69,21 @@ pmap_getport(
{
u_short port = 0;
int socket = -1;
- register CLIENT *client;
+ CLIENT *client;
struct pmap parms;
address->sin_port = htons(PMAPPORT);
client = clntudp_bufcreate(address, PMAPPROG,
PMAPVERS, timeout, &socket, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE);
- if (client != (CLIENT *)NULL) {
+ if (client != NULL) {
parms.pm_prog = program;
parms.pm_vers = version;
parms.pm_prot = protocol;
parms.pm_port = 0; /* not needed or used */
- if (CLNT_CALL(client, PMAPPROC_GETPORT, xdr_pmap, &parms,
- xdr_u_short, &port, tottimeout) != RPC_SUCCESS){
+ if (CLNT_CALL(client, (rpcproc_t)PMAPPROC_GETPORT,
+ (xdrproc_t)xdr_pmap,
+ &parms, (xdrproc_t)xdr_u_short, &port, tottimeout) !=
+ RPC_SUCCESS){
rpc_createerr.cf_stat = RPC_PMAPFAILURE;
clnt_geterr(client, &rpc_createerr.cf_error);
} else if (port == 0) {