From 0ce26895a515dbee47f8ceb272f56dbe89f684e8 Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Thu, 20 May 2010 10:31:23 +0000 Subject: [PATCH] clean code. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@722 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- components/dfs/filesystems/nfs/rpc/clnt_udp.c | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/components/dfs/filesystems/nfs/rpc/clnt_udp.c b/components/dfs/filesystems/nfs/rpc/clnt_udp.c index 81dd9a89cc..177e61acf4 100644 --- a/components/dfs/filesystems/nfs/rpc/clnt_udp.c +++ b/components/dfs/filesystems/nfs/rpc/clnt_udp.c @@ -201,8 +201,7 @@ CLIENT *clntudp_create(struct sockaddr_in *raddr, } static enum clnt_stat -clntudp_call(CLIENT *cl, - unsigned long proc, +clntudp_call(CLIENT *cl, unsigned long proc, xdrproc_t xargs, char* argsp, xdrproc_t xresults, char* resultsp, struct timeval utimeout) @@ -259,6 +258,9 @@ send_again: inlen = recvfrom(cu->cu_sock, cu->cu_inbuf, (int) cu->cu_recvsz, 0, (struct sockaddr *) &from, &fromlen); + + if (inlen <= 0) + rt_kprintf("recv error: len %d, errno %d\n", inlen, lwip_get_error(cu->cu_sock)); }while (inlen < 0 && errno == EINTR); if (inlen < 4) @@ -316,20 +318,14 @@ send_again: return (cu->cu_error.re_status); } -static void clntudp_geterr(cl, errp) -CLIENT *cl; -struct rpc_err *errp; +static void clntudp_geterr(CLIENT *cl, struct rpc_err *errp) { register struct cu_data *cu = (struct cu_data *) cl->cl_private; *errp = cu->cu_error; } - -static bool_t clntudp_freeres(cl, xdr_res, res_ptr) -CLIENT *cl; -xdrproc_t xdr_res; -char* res_ptr; +static bool_t clntudp_freeres(CLIENT *cl, xdrproc_t xdr_res, char* res_ptr) { register struct cu_data *cu = (struct cu_data *) cl->cl_private; register XDR *xdrs = &(cu->cu_outxdrs); @@ -338,15 +334,11 @@ char* res_ptr; return ((*xdr_res) (xdrs, res_ptr)); } -static void clntudp_abort( /*h */ ) -/*CLIENT *h; */ +static void clntudp_abort() { } -static bool_t clntudp_control(cl, request, info) -CLIENT *cl; -int request; -char *info; +static bool_t clntudp_control(CLIENT *cl, int request, char *info) { register struct cu_data *cu = (struct cu_data *) cl->cl_private; @@ -377,8 +369,7 @@ char *info; return (TRUE); } -static void clntudp_destroy(cl) -CLIENT *cl; +static void clntudp_destroy(CLIENT *cl) { register struct cu_data *cu = (struct cu_data *) cl->cl_private; @@ -391,4 +382,3 @@ CLIENT *cl; rt_free(cu); rt_free(cl); } -