summary refs log tree commit diff
path: root/sunrpc/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sunrpc/svc.c')
-rw-r--r--sunrpc/svc.c64
1 files changed, 33 insertions, 31 deletions
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index e0af7107be..5995c25bfd 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -6,23 +6,23 @@
  * may copy or modify Sun RPC without charge, but are not authorized
  * to license or distribute it to anyone else except as part of a product or
  * program developed by the user.
- * 
+ *
  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- * 
+ *
  * Sun RPC is provided with no support and without any obligation on the
  * part of Sun Microsystems, Inc. to assist in its use, correction,
  * modification or enhancement.
- * 
+ *
  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  * OR ANY PART THEREOF.
- * 
+ *
  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  * or profits or other special, indirect and consequential damages, even if
  * Sun has been advised of the possibility of such damages.
- * 
+ *
  * Sun Microsystems, Inc.
  * 2550 Garcia Avenue
  * Mountain View, California  94043
@@ -45,7 +45,9 @@ static char sccsid[] = "@(#)svc.c 1.41 87/10/13 Copyr 1984 Sun Micro";
 #include <rpc/rpc.h>
 #include <rpc/pmap_clnt.h>
 
+#ifndef errno
 extern int errno;
+#endif
 
 #ifdef FD_SETSIZE
 static SVCXPRT **xports;
@@ -103,12 +105,12 @@ xprt_register(xprt)
 }
 
 /*
- * De-activate a transport handle. 
+ * De-activate a transport handle.
  */
 void
-xprt_unregister(xprt) 
+xprt_unregister(xprt)
 	SVCXPRT *xprt;
-{ 
+{
 	register int sock = xprt->xp_sock;
 
 #ifdef FD_SETSIZE
@@ -223,15 +225,15 @@ svc_sendreply(xprt, xdr_results, xdr_location)
 	xdrproc_t xdr_results;
 	caddr_t xdr_location;
 {
-	struct rpc_msg rply; 
+	struct rpc_msg rply;
 
-	rply.rm_direction = REPLY;  
-	rply.rm_reply.rp_stat = MSG_ACCEPTED; 
-	rply.acpted_rply.ar_verf = xprt->xp_verf; 
+	rply.rm_direction = REPLY;
+	rply.rm_reply.rp_stat = MSG_ACCEPTED;
+	rply.acpted_rply.ar_verf = xprt->xp_verf;
 	rply.acpted_rply.ar_stat = SUCCESS;
 	rply.acpted_rply.ar_results.where = xdr_location;
 	rply.acpted_rply.ar_results.proc = xdr_results;
-	return (SVC_REPLY(xprt, &rply)); 
+	return (SVC_REPLY(xprt, &rply));
 }
 
 /*
@@ -257,13 +259,13 @@ void
 svcerr_decode(xprt)
 	register SVCXPRT *xprt;
 {
-	struct rpc_msg rply; 
+	struct rpc_msg rply;
 
-	rply.rm_direction = REPLY; 
-	rply.rm_reply.rp_stat = MSG_ACCEPTED; 
+	rply.rm_direction = REPLY;
+	rply.rm_reply.rp_stat = MSG_ACCEPTED;
 	rply.acpted_rply.ar_verf = xprt->xp_verf;
 	rply.acpted_rply.ar_stat = GARBAGE_ARGS;
-	SVC_REPLY(xprt, &rply); 
+	SVC_REPLY(xprt, &rply);
 }
 
 /*
@@ -273,13 +275,13 @@ void
 svcerr_systemerr(xprt)
 	register SVCXPRT *xprt;
 {
-	struct rpc_msg rply; 
+	struct rpc_msg rply;
 
-	rply.rm_direction = REPLY; 
-	rply.rm_reply.rp_stat = MSG_ACCEPTED; 
+	rply.rm_direction = REPLY;
+	rply.rm_reply.rp_stat = MSG_ACCEPTED;
 	rply.acpted_rply.ar_verf = xprt->xp_verf;
 	rply.acpted_rply.ar_stat = SYSTEM_ERR;
-	SVC_REPLY(xprt, &rply); 
+	SVC_REPLY(xprt, &rply);
 }
 
 /*
@@ -313,15 +315,15 @@ svcerr_weakauth(xprt)
 /*
  * Program unavailable error reply
  */
-void 
+void
 svcerr_noprog(xprt)
 	register SVCXPRT *xprt;
 {
-	struct rpc_msg rply;  
+	struct rpc_msg rply;
 
-	rply.rm_direction = REPLY;   
-	rply.rm_reply.rp_stat = MSG_ACCEPTED;  
-	rply.acpted_rply.ar_verf = xprt->xp_verf;  
+	rply.rm_direction = REPLY;
+	rply.rm_reply.rp_stat = MSG_ACCEPTED;
+	rply.acpted_rply.ar_verf = xprt->xp_verf;
 	rply.acpted_rply.ar_stat = PROG_UNAVAIL;
 	SVC_REPLY(xprt, &rply);
 }
@@ -329,9 +331,9 @@ svcerr_noprog(xprt)
 /*
  * Program version mismatch error reply
  */
-void  
+void
 svcerr_progvers(xprt, low_vers, high_vers)
-	register SVCXPRT *xprt; 
+	register SVCXPRT *xprt;
 	u_long low_vers;
 	u_long high_vers;
 {
@@ -356,9 +358,9 @@ svcerr_progvers(xprt, low_vers, high_vers)
  * the "raw" parameters (msg.rm_call.cb_cred and msg.rm_call.cb_verf) and
  * the "cooked" credentials (rqst->rq_clntcred).
  * However, this function does not know the structure of the cooked
- * credentials, so it make the following assumptions: 
+ * credentials, so it make the following assumptions:
  *   a) the structure is contiguous (no pointers), and
- *   b) the cred structure size does not exceed RQCRED_SIZE bytes. 
+ *   b) the cred structure size does not exceed RQCRED_SIZE bytes.
  * In all events, all three parameters are freed upon exit from this routine.
  * The storage is trivially management on the call stack in user land, but
  * is mallocated in kernel land.
@@ -410,7 +412,7 @@ svc_getreqset(readfds)
 
 
 #ifdef FD_SETSIZE
-	setsize = _rpc_dtablesize();	
+	setsize = _rpc_dtablesize();
 	maskp = (u_int32_t *)readfds->fds_bits;
 	for (sock = 0; sock < setsize; sock += 32) {
 	    for (mask = *maskp++; bit = ffs(mask); mask ^= (1 << (bit - 1))) {