summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc')
-rw-r--r--lib/libc/rpc/clnt_raw.c11
-rw-r--r--lib/libc/rpc/getnetconfig.c4
-rw-r--r--lib/libc/rpc/getnetpath.c2
-rw-r--r--lib/libc/rpc/getrpcent.c2
-rw-r--r--lib/libc/rpc/key_call.c2
-rw-r--r--lib/libc/rpc/svc.c4
-rw-r--r--lib/libc/rpc/svc_auth_des.c8
-rw-r--r--lib/libc/rpc/svc_raw.c5
8 files changed, 20 insertions, 18 deletions
diff --git a/lib/libc/rpc/clnt_raw.c b/lib/libc/rpc/clnt_raw.c
index 9d34a3d..cd3a384 100644
--- a/lib/libc/rpc/clnt_raw.c
+++ b/lib/libc/rpc/clnt_raw.c
@@ -92,13 +92,13 @@ clnt_raw_create(prog, vers)
rpcprog_t prog;
rpcvers_t vers;
{
- struct clntraw_private *clp = clntraw_private;
+ struct clntraw_private *clp;
struct rpc_msg call_msg;
- XDR *xdrs = &clp->xdr_stream;
- CLIENT *client = &clp->client_object;
+ XDR *xdrs;
+ CLIENT *client;
mutex_lock(&clntraw_lock);
- if (clp == NULL) {
+ if ((clp = clntraw_private) == NULL) {
clp = (struct clntraw_private *)calloc(1, sizeof (*clp));
if (clp == NULL) {
mutex_unlock(&clntraw_lock);
@@ -110,6 +110,9 @@ clnt_raw_create(prog, vers)
clp->_raw_buf = __rpc_rawcombuf;
clntraw_private = clp;
}
+ xdrs = &clp->xdr_stream;
+ client = &clp->client_object;
+
/*
* pre-serialize the static part of the call msg and stash it away
*/
diff --git a/lib/libc/rpc/getnetconfig.c b/lib/libc/rpc/getnetconfig.c
index 9baa224..e5db51a 100644
--- a/lib/libc/rpc/getnetconfig.c
+++ b/lib/libc/rpc/getnetconfig.c
@@ -412,13 +412,13 @@ void *handlep;
* Noone needs these entries anymore, then frees them.
* Make sure all info in netconfig_info structure has been reinitialized.
*/
- q = p = ni.head;
+ q = ni.head;
ni.eof = ni.ref = 0;
ni.head = NULL;
ni.tail = NULL;
mutex_unlock(&ni_lock);
- while (q) {
+ while (q != NULL) {
p = q->next;
if (q->ncp->nc_lookups != NULL) free(q->ncp->nc_lookups);
free(q->ncp);
diff --git a/lib/libc/rpc/getnetpath.c b/lib/libc/rpc/getnetpath.c
index 0563544..d1ea554 100644
--- a/lib/libc/rpc/getnetpath.c
+++ b/lib/libc/rpc/getnetpath.c
@@ -101,7 +101,7 @@ setnetpath()
if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) {
free(np_sessionp);
syslog (LOG_ERR, "rpc: failed to open " NETCONFIG);
- goto failed;
+ return (NULL);
}
np_sessionp->valid = NP_VALID;
np_sessionp->ncp_list = NULL;
diff --git a/lib/libc/rpc/getrpcent.c b/lib/libc/rpc/getrpcent.c
index abee480..1f198fa 100644
--- a/lib/libc/rpc/getrpcent.c
+++ b/lib/libc/rpc/getrpcent.c
@@ -698,7 +698,7 @@ rpc_marshal_func(char *buffer, size_t *buffer_size, void *retval, va_list ap,
return (NS_RETURN);
}
- memcpy(&new_rpc, rpc, sizeof(struct rpcent));
+ new_rpc = *rpc;
*buffer_size = desired_size;
memset(buffer, 0, desired_size);
diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c
index 615f24d..6cc1139 100644
--- a/lib/libc/rpc/key_call.c
+++ b/lib/libc/rpc/key_call.c
@@ -302,7 +302,7 @@ int vers;
void *localhandle;
struct netconfig *nconf;
struct netconfig *tpconf;
- struct key_call_private *kcp = key_call_private_main;
+ struct key_call_private *kcp;
struct timeval wait_time;
struct utsname u;
int main_thread;
diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c
index d205121..282c2be 100644
--- a/lib/libc/rpc/svc.c
+++ b/lib/libc/rpc/svc.c
@@ -627,8 +627,8 @@ svc_getreqset(readfds)
maskp = readfds->fds_bits;
for (sock = 0; sock < FD_SETSIZE; sock += NFDBITS) {
- for (mask = *maskp++; (bit = ffs(mask)) != 0;
- mask ^= (1 << (bit - 1))) {
+ for (mask = *maskp++; (bit = ffsl(mask)) != 0;
+ mask ^= (1ul << (bit - 1))) {
/* sock has input waiting */
fd = sock + bit - 1;
svc_getreq_common(fd);
diff --git a/lib/libc/rpc/svc_auth_des.c b/lib/libc/rpc/svc_auth_des.c
index 84f1e19..de4d1b4 100644
--- a/lib/libc/rpc/svc_auth_des.c
+++ b/lib/libc/rpc/svc_auth_des.c
@@ -449,10 +449,10 @@ cache_spot(key, name, timestamp)
#define INVALID -1 /* grouplen, if cache entry is invalid */
struct bsdcred {
- short uid; /* cached uid */
- short gid; /* cached gid */
- short grouplen; /* length of cached groups */
- short groups[NGROUPS]; /* cached groups */
+ uid_t uid; /* cached uid */
+ gid_t gid; /* cached gid */
+ int grouplen; /* length of cached groups */
+ gid_t groups[NGRPS]; /* cached groups */
};
/*
diff --git a/lib/libc/rpc/svc_raw.c b/lib/libc/rpc/svc_raw.c
index 7492046..67bcba1 100644
--- a/lib/libc/rpc/svc_raw.c
+++ b/lib/libc/rpc/svc_raw.c
@@ -176,9 +176,8 @@ svc_raw_reply(xprt, msg)
msg->acpted_rply.ar_results.proc = (xdrproc_t) xdr_void;
msg->acpted_rply.ar_results.where = NULL;
- if (!xdr_replymsg(xdrs, msg) ||
- !SVCAUTH_WRAP(&SVC_AUTH(xprt), xdrs, xdr_proc, xdr_where))
- stat = FALSE;
+ stat = xdr_replymsg(xdrs, msg) &&
+ SVCAUTH_WRAP(&SVC_AUTH(xprt), xdrs, xdr_proc, xdr_where);
} else {
stat = xdr_replymsg(xdrs, msg);
}
OpenPOWER on IntegriCloud