diff options
author | pfg <pfg@FreeBSD.org> | 2016-06-09 19:44:47 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2016-06-09 19:44:47 +0000 |
commit | fbb0754872307460f78291028cf4338e7fe6ebf5 (patch) | |
tree | e53ed4df65282c8ba4ae74576c46716b065a70ef /lib/libc | |
parent | 1fe673114b73ba94967e31448f3d0237ba86d32a (diff) | |
download | FreeBSD-src-fbb0754872307460f78291028cf4338e7fe6ebf5.zip FreeBSD-src-fbb0754872307460f78291028cf4338e7fe6ebf5.tar.gz |
libc/rpc: Make use of some xdr_* macros.
xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD
but were fixed in r296394. Give them some use hoping they help make
the code somewhat more readable.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/rpc/rpc_prot.c | 4 | ||||
-rw-r--r-- | lib/libc/rpc/rpcb_prot.c | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/libc/rpc/rpc_prot.c b/lib/libc/rpc/rpc_prot.c index 53fc70a..cd38ac1 100644 --- a/lib/libc/rpc/rpc_prot.c +++ b/lib/libc/rpc/rpc_prot.c @@ -217,8 +217,8 @@ xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) (xdrs->x_op == XDR_ENCODE) && xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) && xdr_enum(xdrs, (enum_t *) prm_direction) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) ) + xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_rpcvers)) && + xdr_rpcprog(xdrs, &(cmsg->rm_call.cb_prog)) ) return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers))); return (FALSE); } diff --git a/lib/libc/rpc/rpcb_prot.c b/lib/libc/rpc/rpcb_prot.c index 2b87f34..c462e19 100644 --- a/lib/libc/rpc/rpcb_prot.c +++ b/lib/libc/rpc/rpcb_prot.c @@ -56,10 +56,10 @@ __FBSDID("$FreeBSD$"); bool_t xdr_rpcb(XDR *xdrs, RPCB *objp) { - if (!xdr_u_int32_t(xdrs, &objp->r_prog)) { + if (!xdr_rpcprog(xdrs, &objp->r_prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->r_vers)) { + if (!xdr_rpcvers(xdrs, &objp->r_vers)) { return (FALSE); } if (!xdr_string(xdrs, &objp->r_netid, (u_int)~0)) { @@ -243,13 +243,13 @@ xdr_rpcb_rmtcallargs(XDR *xdrs, struct rpcb_rmtcallargs *p) buf = XDR_INLINE(xdrs, 3 * BYTES_PER_XDR_UNIT); if (buf == NULL) { - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } } else { |