Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/rpc knf - no functional changes
details: https://anonhg.NetBSD.org/src/rev/f4902d5d78c1
branches: trunk
changeset: 761665:f4902d5d78c1
user: christos <christos%NetBSD.org@localhost>
date: Fri Feb 04 17:36:54 2011 +0000
description:
knf - no functional changes
diffstat:
lib/libc/rpc/svc_vc.c | 170 ++++++++++++++++++-------------------------------
1 files changed, 63 insertions(+), 107 deletions(-)
diffs (truncated from 408 to 300 lines):
diff -r 4b7be10d8b67 -r f4902d5d78c1 lib/libc/rpc/svc_vc.c
--- a/lib/libc/rpc/svc_vc.c Fri Feb 04 16:30:32 2011 +0000
+++ b/lib/libc/rpc/svc_vc.c Fri Feb 04 17:36:54 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: svc_vc.c,v 1.22 2009/02/12 04:38:52 lukem Exp $ */
+/* $NetBSD: svc_vc.c,v 1.23 2011/02/04 17:36:54 christos Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
static char *sccsid = "@(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";
static char *sccsid = "@(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC";
#else
-__RCSID("$NetBSD: svc_vc.c,v 1.22 2009/02/12 04:38:52 lukem Exp $");
+__RCSID("$NetBSD: svc_vc.c,v 1.23 2011/02/04 17:36:54 christos Exp $");
#endif
#endif
@@ -79,23 +79,22 @@
extern rwlock_t svc_fd_lock;
#endif
-static SVCXPRT *makefd_xprt __P((int, u_int, u_int));
-static bool_t rendezvous_request __P((SVCXPRT *, struct rpc_msg *));
-static enum xprt_stat rendezvous_stat __P((SVCXPRT *));
-static void svc_vc_destroy __P((SVCXPRT *));
-static void __svc_vc_dodestroy __P((SVCXPRT *));
-static int read_vc __P((caddr_t, caddr_t, int));
-static int write_vc __P((caddr_t, caddr_t, int));
-static enum xprt_stat svc_vc_stat __P((SVCXPRT *));
-static bool_t svc_vc_recv __P((SVCXPRT *, struct rpc_msg *));
-static bool_t svc_vc_getargs __P((SVCXPRT *, xdrproc_t, caddr_t));
-static bool_t svc_vc_freeargs __P((SVCXPRT *, xdrproc_t, caddr_t));
-static bool_t svc_vc_reply __P((SVCXPRT *, struct rpc_msg *));
-static void svc_vc_rendezvous_ops __P((SVCXPRT *));
-static void svc_vc_ops __P((SVCXPRT *));
-static bool_t svc_vc_control __P((SVCXPRT *, const u_int, void *));
-static bool_t svc_vc_rendezvous_control __P((SVCXPRT *, const u_int,
- void *));
+static SVCXPRT *makefd_xprt(int, u_int, u_int);
+static bool_t rendezvous_request(SVCXPRT *, struct rpc_msg *);
+static enum xprt_stat rendezvous_stat(SVCXPRT *);
+static void svc_vc_destroy(SVCXPRT *);
+static void __svc_vc_dodestroy(SVCXPRT *);
+static int read_vc(caddr_t, caddr_t, int);
+static int write_vc(caddr_t, caddr_t, int);
+static enum xprt_stat svc_vc_stat(SVCXPRT *);
+static bool_t svc_vc_recv(SVCXPRT *, struct rpc_msg *);
+static bool_t svc_vc_getargs(SVCXPRT *, xdrproc_t, caddr_t);
+static bool_t svc_vc_freeargs(SVCXPRT *, xdrproc_t, caddr_t);
+static bool_t svc_vc_reply(SVCXPRT *, struct rpc_msg *);
+static void svc_vc_rendezvous_ops(SVCXPRT *);
+static void svc_vc_ops(SVCXPRT *);
+static bool_t svc_vc_control(SVCXPRT *, const u_int, void *);
+static bool_t svc_vc_rendezvous_control(SVCXPRT *, const u_int, void *);
struct cf_rendezvous { /* kept in xprt->xp_p1 for rendezvouser */
u_int sendsize;
@@ -132,10 +131,7 @@
* 0 => use the system default.
*/
SVCXPRT *
-svc_vc_create(fd, sendsize, recvsize)
- int fd;
- u_int sendsize;
- u_int recvsize;
+svc_vc_create(int fd, u_int sendsize, u_int recvsize)
{
SVCXPRT *xprt;
struct cf_rendezvous *r = NULL;
@@ -192,13 +188,13 @@
xprt->xp_rtaddr.maxlen = sizeof (struct sockaddr_storage);
xprt_register(xprt);
- return (xprt);
+ return xprt;
cleanup_svc_vc_create:
if (xprt)
mem_free(xprt, sizeof(*xprt));
if (r != NULL)
mem_free(r, sizeof(*r));
- return (NULL);
+ return NULL;
}
/*
@@ -206,10 +202,7 @@
* descriptor as its first input.
*/
SVCXPRT *
-svc_fd_create(fd, sendsize, recvsize)
- int fd;
- u_int sendsize;
- u_int recvsize;
+svc_fd_create(int fd, u_int sendsize, u_int recvsize)
{
struct sockaddr_storage ss;
socklen_t slen;
@@ -263,10 +256,7 @@
}
static SVCXPRT *
-makefd_xprt(fd, sendsize, recvsize)
- int fd;
- u_int sendsize;
- u_int recvsize;
+makefd_xprt(int fd, u_int sendsize, u_int recvsize)
{
SVCXPRT *xprt;
struct cf_conn *cd;
@@ -295,7 +285,7 @@
goto out;
xprt_register(xprt);
- return (xprt);
+ return xprt;
out:
warn("svc_tcp: makefd_xprt");
if (xprt)
@@ -305,9 +295,7 @@
/*ARGSUSED*/
static bool_t
-rendezvous_request(xprt, msg)
- SVCXPRT *xprt;
- struct rpc_msg *msg;
+rendezvous_request(SVCXPRT *xprt, struct rpc_msg *msg)
{
int sock, flags;
struct cf_rendezvous *r;
@@ -337,7 +325,7 @@
if (__svc_clean_idle(&cleanfds, 0, FALSE))
goto again;
}
- return (FALSE);
+ return FALSE;
}
/*
* make a new transporter (re-uses xprt)
@@ -380,24 +368,22 @@
(void)gettimeofday(&cd->last_recv_time, NULL);
- return (FALSE); /* there is never an rpc msg to be processed */
+ return FALSE; /* there is never an rpc msg to be processed */
out:
(void)close(sock);
- return (FALSE); /* there was an error */
+ return FALSE; /* there was an error */
}
/*ARGSUSED*/
static enum xprt_stat
-rendezvous_stat(xprt)
- SVCXPRT *xprt;
+rendezvous_stat(SVCXPRT *xprt)
{
- return (XPRT_IDLE);
+ return XPRT_IDLE;
}
static void
-svc_vc_destroy(xprt)
- SVCXPRT *xprt;
+svc_vc_destroy(SVCXPRT *xprt)
{
_DIAGASSERT(xprt != NULL);
@@ -406,8 +392,7 @@
}
static void
-__svc_vc_dodestroy(xprt)
- SVCXPRT *xprt;
+__svc_vc_dodestroy(SVCXPRT *xprt)
{
struct cf_conn *cd;
struct cf_rendezvous *r;
@@ -439,26 +424,20 @@
/*ARGSUSED*/
static bool_t
-svc_vc_control(xprt, rq, in)
- SVCXPRT *xprt;
- const u_int rq;
- void *in;
+svc_vc_control(SVCXPRT *xprt, const u_int rq, void *in)
{
- return (FALSE);
+ return FALSE;
}
/*ARGSUSED*/
static bool_t
-svc_vc_rendezvous_control(xprt, rq, in)
- SVCXPRT *xprt;
- const u_int rq;
- void *in;
+svc_vc_rendezvous_control(SVCXPRT *xprt, const u_int rq, void *in)
{
struct cf_rendezvous *cfp;
cfp = (struct cf_rendezvous *)xprt->xp_p1;
if (cfp == NULL)
- return (FALSE);
+ return FALSE;
switch (rq) {
case SVCGET_CONNMAXREC:
*(int *)in = cfp->maxrec;
@@ -467,9 +446,9 @@
cfp->maxrec = *(int *)in;
break;
default:
- return (FALSE);
+ return FALSE;
}
- return (TRUE);
+ return TRUE;
}
/*
@@ -480,10 +459,7 @@
* fatal for the connection.
*/
static int
-read_vc(xprtp, buf, len)
- caddr_t xprtp;
- caddr_t buf;
- int len;
+read_vc(caddr_t xprtp, caddr_t buf, int len)
{
SVCXPRT *xprt;
int sock;
@@ -571,14 +547,14 @@
if ((len = read(sock, buf, (size_t)len)) > 0) {
gettimeofday(&cfp->last_recv_time, NULL);
- return (len);
+ return len;
}
fatal_err:
if (crmsg != NULL)
free(crmsg);
((struct cf_conn *)(xprt->xp_p1))->strm_stat = XPRT_DIED;
- return (-1);
+ return -1;
}
/*
@@ -586,10 +562,7 @@
* Any error is fatal and the connection is closed.
*/
static int
-write_vc(xprtp, buf, len)
- caddr_t xprtp;
- caddr_t buf;
- int len;
+write_vc(caddr_t xprtp, caddr_t buf, int len)
{
SVCXPRT *xprt;
int i, cnt;
@@ -608,7 +581,7 @@
if ((i = write(xprt->xp_fd, buf, (size_t)cnt)) < 0) {
if (errno != EAGAIN || !cd->nonblock) {
cd->strm_stat = XPRT_DIED;
- return (-1);
+ return -1;
}
if (cd->nonblock && i != cnt) {
/*
@@ -621,17 +594,16 @@
gettimeofday(&tv1, NULL);
if (tv1.tv_sec - tv0.tv_sec >= 2) {
cd->strm_stat = XPRT_DIED;
- return (-1);
+ return -1;
}
}
}
}
- return (len);
+ return len;
}
static enum xprt_stat
-svc_vc_stat(xprt)
- SVCXPRT *xprt;
+svc_vc_stat(SVCXPRT *xprt)
{
struct cf_conn *cd;
@@ -640,16 +612,14 @@
cd = (struct cf_conn *)(xprt->xp_p1);
if (cd->strm_stat == XPRT_DIED)
- return (XPRT_DIED);
+ return XPRT_DIED;
if (! xdrrec_eof(&(cd->xdrs)))
Home |
Main Index |
Thread Index |
Old Index