[DFS] fix compiling warning in NFS

This commit is contained in:
bernard
2014-03-10 11:48:47 +08:00
parent d0d239cd4c
commit 6cab3b7dfa
7 changed files with 39 additions and 138 deletions

View File

@@ -73,6 +73,7 @@ AUTH *authnone_create()
register struct authnone_private *ap = authnone_private;
XDR xdr_stream;
register XDR *xdrs;
extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap);
if (ap == 0) {
ap = (struct authnone_private *) rt_malloc (sizeof(*ap));
@@ -95,9 +96,7 @@ AUTH *authnone_create()
}
/*ARGSUSED*/
static bool_t authnone_marshal(client, xdrs)
AUTH *client;
XDR *xdrs;
static bool_t authnone_marshal(AUTH *client, XDR *xdrs)
{
register struct authnone_private *ap = authnone_private;

View File

@@ -135,6 +135,10 @@ CLIENT *clntudp_bufcreate(struct sockaddr_in *raddr,
if (raddr->sin_port == 0) {
unsigned short port;
extern unsigned short pmap_getport(struct sockaddr_in *address,
unsigned long program,
unsigned long version,
unsigned int protocol);
if ((port =
pmap_getport(raddr, program, version, IPPROTO_UDP)) == 0) {
@@ -165,8 +169,6 @@ CLIENT *clntudp_bufcreate(struct sockaddr_in *raddr,
cu->cu_xdrpos = XDR_GETPOS(&(cu->cu_outxdrs));
if (*sockp < 0)
{
int dontblock = 1;
*sockp = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (*sockp < 0)
{
@@ -229,7 +231,10 @@ call_again:
if ((!XDR_PUTLONG(xdrs, (long *) &proc)) ||
(!AUTH_MARSHALL(cl->cl_auth, xdrs)) || (!(*xargs) (xdrs, argsp)))
return (cu->cu_error.re_status = RPC_CANTENCODEARGS);
{
cu->cu_error.re_status = RPC_CANTENCODEARGS;
return RPC_CANTENCODEARGS;
}
outlen = (int) XDR_GETPOS(xdrs);
send_again:
@@ -238,7 +243,9 @@ send_again:
!= outlen)
{
cu->cu_error.re_errno = errno;
return (cu->cu_error.re_status = RPC_CANTSEND);
cu->cu_error.re_status = RPC_CANTSEND;
return RPC_CANTSEND;
}
/*
@@ -264,7 +271,9 @@ send_again:
{
rt_kprintf("recv error, len %d\n", inlen);
cu->cu_error.re_errno = errno;
return (cu->cu_error.re_status = RPC_CANTRECV);
cu->cu_error.re_status = RPC_CANTRECV;
return RPC_CANTRECV;
}
/* see if reply transaction id matches sent id */
@@ -292,6 +301,8 @@ send_again:
}
if (reply_msg.acpted_rply.ar_verf.oa_base != NULL)
{
extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap);
xdrs->x_op = XDR_FREE;
(void) xdr_opaque_auth(xdrs, &(reply_msg.acpted_rply.ar_verf));
}
@@ -311,7 +322,7 @@ send_again:
cu->cu_error.re_status = RPC_CANTDECODERES;
}
return (cu->cu_error.re_status);
return (enum clnt_stat)(cu->cu_error.re_status);
}
static void clntudp_geterr(CLIENT *cl, struct rpc_err *errp)

View File

@@ -6,9 +6,7 @@ static struct timeval timeout = { 5, 0 };
static struct timeval tottimeout = { 60, 0 };
bool_t xdr_pmap(xdrs, regs)
XDR *xdrs;
struct pmap *regs;
bool_t xdr_pmap(XDR *xdrs, struct pmap *regs)
{
if (xdr_u_long(xdrs, &regs->pm_prog) &&
xdr_u_long(xdrs, &regs->pm_vers) &&
@@ -22,11 +20,7 @@ struct pmap *regs;
* Calls the pmap service remotely to do the lookup.
* Returns 0 if no map exists.
*/
unsigned short pmap_getport(address, program, version, protocol)
struct sockaddr_in *address;
unsigned long program;
unsigned long version;
unsigned int protocol;
unsigned short pmap_getport(struct sockaddr_in *address, unsigned long program, unsigned long version, unsigned int protocol)
{
unsigned short port = 0;
int socket = -1;

View File

@@ -52,9 +52,7 @@ static char sccsid[] = "@(#)rpc_prot.c 1.36 87/08/11 Copyr 1984 Sun Micro";
* XDR an opaque authentication struct
* (see auth.h)
*/
bool_t xdr_opaque_auth(xdrs, ap)
register XDR *xdrs;
register struct opaque_auth *ap;
bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap)
{
if (xdr_enum(xdrs, &(ap->oa_flavor)))
@@ -66,9 +64,7 @@ register struct opaque_auth *ap;
/*
* XDR a DES block
*/
bool_t xdr_des_block(xdrs, blkp)
register XDR *xdrs;
register des_block *blkp;
bool_t xdr_des_block(XDR *xdrs, des_block *blkp)
{
return (xdr_opaque(xdrs, (char*) blkp, sizeof(des_block)));
}
@@ -78,9 +74,7 @@ register des_block *blkp;
/*
* XDR the MSG_ACCEPTED part of a reply message union
*/
static bool_t xdr_accepted_reply(xdrs, ar)
register XDR *xdrs;
register struct accepted_reply *ar;
static bool_t xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar)
{
/* personalized union, rather than calling xdr_union */
@@ -104,9 +98,7 @@ register struct accepted_reply *ar;
/*
* XDR the MSG_DENIED part of a reply message union
*/
static bool_t xdr_rejected_reply(xdrs, rr)
register XDR *xdrs;
register struct rejected_reply *rr;
static bool_t xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr)
{
/* personalized union, rather than calling xdr_union */
@@ -134,9 +126,7 @@ static struct xdr_discrim reply_dscrm[3] = {
/*
* XDR a reply message
*/
bool_t xdr_replymsg(xdrs, rmsg)
register XDR *xdrs;
register struct rpc_msg *rmsg;
bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg)
{
if (xdr_u_long(xdrs, &(rmsg->rm_xid)) &&
xdr_enum(xdrs, (enum_t *) & (rmsg->rm_direction)) &&
@@ -153,9 +143,7 @@ register struct rpc_msg *rmsg;
* The fields include: rm_xid, rm_direction, rpcvers, prog, and vers.
* The rm_xid is not really static, but the user can easily munge on the fly.
*/
bool_t xdr_callhdr(xdrs, cmsg)
register XDR *xdrs;
register struct rpc_msg *cmsg;
bool_t xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg)
{
cmsg->rm_direction = CALL;
@@ -172,9 +160,7 @@ register struct rpc_msg *cmsg;
/* ************************** Client utility routine ************* */
static void accepted(acpt_stat, error)
register enum accept_stat acpt_stat;
register struct rpc_err *error;
static void accepted(enum accept_stat acpt_stat, struct rpc_err *error)
{
switch (acpt_stat) {
@@ -209,9 +195,7 @@ register struct rpc_err *error;
error->re_lb.s2 = (long) acpt_stat;
}
static void rejected(rjct_stat, error)
register enum reject_stat rjct_stat;
register struct rpc_err *error;
static void rejected(enum reject_stat rjct_stat, struct rpc_err *error)
{
switch (rjct_stat) {
@@ -233,9 +217,7 @@ register struct rpc_err *error;
/*
* given a reply message, fills in the error
*/
void _seterr_reply(msg, error)
register struct rpc_msg *msg;
register struct rpc_err *error;
void _seterr_reply(struct rpc_msg *msg, struct rpc_err *error)
{
/* optimized for normal, SUCCESSful case */
@@ -246,11 +228,11 @@ register struct rpc_err *error;
error->re_status = RPC_SUCCESS;
return;
};
accepted(msg->acpted_rply.ar_stat, error);
accepted((enum accept_stat)msg->acpted_rply.ar_stat, error);
break;
case MSG_DENIED:
rejected(msg->rjcted_rply.rj_stat, error);
rejected((enum reject_stat)msg->rjcted_rply.rj_stat, error);
break;
default:

View File

@@ -135,9 +135,7 @@ static unsigned int xdrmem_getpos (const XDR *xdrs)
return ((unsigned long) xdrs->x_private - (unsigned long) xdrs->x_base);
}
static bool_t xdrmem_setpos(xdrs, pos)
register XDR *xdrs;
unsigned int pos;
static bool_t xdrmem_setpos(XDR *xdrs, unsigned int pos)
{
register char* newaddr = xdrs->x_base + pos;
register char* lastaddr = xdrs->x_private + xdrs->x_handy;