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.
This commit is contained in:
pfg 2016-06-09 19:44:47 +00:00
parent 1fe673114b
commit fbb0754872
2 changed files with 7 additions and 7 deletions

View File

@ -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);
}

View File

@ -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 {