diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c index c7f93b205270..0f20177c18e4 100644 --- a/lib/libc/rpc/bindresvport.c +++ b/lib/libc/rpc/bindresvport.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)bindresvport.c 1.8 88/02/08 SMI";*/ /*static char *sccsid = "from: @(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: bindresvport.c,v 1.2 1995/05/30 05:41:13 rgrimes Exp $"; +static char *rcsid = "$Id: bindresvport.c,v 1.3 1995/10/22 14:51:11 phk Exp $"; #endif /* @@ -47,14 +47,13 @@ static char *rcsid = "$Id: bindresvport.c,v 1.2 1995/05/30 05:41:13 rgrimes Exp /* * Bind a socket to a privileged IP port */ -bindresvport(sd, sin) +int bindresvport(sd, sin) int sd; struct sockaddr_in *sin; { int res; static short port; struct sockaddr_in myaddr; - extern int errno; int i; #define STARTPORT 600 diff --git a/lib/libc/rpc/clnt_tcp.c b/lib/libc/rpc/clnt_tcp.c index ebe238db6069..be0709013654 100644 --- a/lib/libc/rpc/clnt_tcp.c +++ b/lib/libc/rpc/clnt_tcp.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)clnt_tcp.c 1.37 87/10/05 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)clnt_tcp.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: clnt_tcp.c,v 1.4 1995/10/27 16:56:50 adam Exp $"; +static char *rcsid = "$Id: clnt_tcp.c,v 1.5 1995/12/07 12:50:53 bde Exp $"; #endif /* @@ -64,7 +64,9 @@ static char *rcsid = "$Id: clnt_tcp.c,v 1.4 1995/10/27 16:56:50 adam Exp $"; #define MCALL_MSG_SIZE 24 -extern int errno; +int bindresvport(int sd, struct sockaddr_in *); +int _rpc_dtablesize(void); +bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); static int readtcp(); static int writetcp(); @@ -121,7 +123,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) u_int recvsz; { CLIENT *h; - register struct ct_data *ct; + register struct ct_data *ct = NULL; struct timeval now; struct rpc_msg call_msg; @@ -219,8 +221,10 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) /* * Something goofed, free stuff and barf */ - mem_free((caddr_t)ct, sizeof(struct ct_data)); - mem_free((caddr_t)h, sizeof(CLIENT)); + if (ct) + mem_free((caddr_t)ct, sizeof(struct ct_data)); + if (h) + mem_free((caddr_t)h, sizeof(CLIENT)); return ((CLIENT *)NULL); } diff --git a/lib/libc/rpc/clnt_udp.c b/lib/libc/rpc/clnt_udp.c index d0da4950eaf8..28dfddc23804 100644 --- a/lib/libc/rpc/clnt_udp.c +++ b/lib/libc/rpc/clnt_udp.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)clnt_udp.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: clnt_udp.c,v 1.5 1995/10/22 14:51:21 phk Exp $"; +static char *rcsid = "$Id: clnt_udp.c,v 1.6 1995/12/07 12:50:54 bde Exp $"; #endif /* @@ -50,7 +50,9 @@ static char *rcsid = "$Id: clnt_udp.c,v 1.5 1995/10/22 14:51:21 phk Exp $"; #include #include -extern int errno; +int bindresvport(int sd, struct sockaddr_in *); +int _rpc_dtablesize(void); +bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); /* * UDP bases client side rpc operations @@ -117,7 +119,7 @@ clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz) u_int recvsz; { CLIENT *cl; - register struct cu_data *cu; + register struct cu_data *cu = NULL; struct timeval now; struct rpc_msg call_msg; diff --git a/lib/libc/rpc/pmap_getmaps.c b/lib/libc/rpc/pmap_getmaps.c index cbb1a4318b5f..6119fc057515 100644 --- a/lib/libc/rpc/pmap_getmaps.c +++ b/lib/libc/rpc/pmap_getmaps.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_getmaps.c 1.10 87/08/11 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_getmaps.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_getmaps.c,v 1.2 1995/05/30 05:41:23 rgrimes Exp $"; +static char *rcsid = "$Id: pmap_getmaps.c,v 1.3 1995/10/22 14:51:29 phk Exp $"; #endif /* @@ -54,8 +54,6 @@ static char *rcsid = "$Id: pmap_getmaps.c,v 1.2 1995/05/30 05:41:23 rgrimes Exp #define NAMELEN 255 #define MAX_BROADCAST_SIZE 1400 -extern int errno; - /* * Get a copy of the current port maps. * Calls the pmap service remotely to do get the maps. diff --git a/lib/libc/rpc/pmap_rmt.c b/lib/libc/rpc/pmap_rmt.c index 4b907ab10265..c61769fe7615 100644 --- a/lib/libc/rpc/pmap_rmt.c +++ b/lib/libc/rpc/pmap_rmt.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)pmap_rmt.c 2.2 88/08/01 4.0 RPCSRC";*/ -static char *rcsid = "$Id: pmap_rmt.c,v 1.4 1995/12/07 12:50:55 bde Exp $"; +static char *rcsid = "$Id: pmap_rmt.c,v 1.5 1996/03/17 20:12:53 guido Exp $"; #endif /* @@ -55,9 +55,9 @@ static char *rcsid = "$Id: pmap_rmt.c,v 1.4 1995/12/07 12:50:55 bde Exp $"; #include #define MAX_BROADCAST_SIZE 1400 -extern int errno; static struct timeval timeout = { 3, 0 }; ++int _rpc_dtablesize(void); /* * pmapper remote-call-service interface. diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c index 809cbfb596e7..3bc9c1ddc0f4 100644 --- a/lib/libc/rpc/svc.c +++ b/lib/libc/rpc/svc.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc.c 1.44 88/02/08 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc.c 2.4 88/08/11 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc.c,v 1.2 1995/05/30 05:41:31 rgrimes Exp $"; +static char *rcsid = "$Id: svc.c,v 1.3 1995/10/22 14:51:34 phk Exp $"; #endif /* @@ -49,8 +49,6 @@ static char *rcsid = "$Id: svc.c,v 1.2 1995/05/30 05:41:31 rgrimes Exp $"; #include #include -extern int errno; - #ifdef FD_SETSIZE static SVCXPRT **xports; #else @@ -62,6 +60,8 @@ static SVCXPRT *xports[NOFILE]; #define NULL_SVC ((struct svc_callout *)0) #define RQCRED_SIZE 400 /* this size is excessive */ +int _rpc_dtablesize(void); + /* * The services list * Each entry represents a set of procedures (an rpc program). diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c index 730acd3f1907..5c8486490a6b 100644 --- a/lib/libc/rpc/svc_run.c +++ b/lib/libc/rpc/svc_run.c @@ -30,7 +30,7 @@ #if defined(LIBC_SCCS) && !defined(lint) /*static char *sccsid = "from: @(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro";*/ /*static char *sccsid = "from: @(#)svc_run.c 2.1 88/07/29 4.0 RPCSRC";*/ -static char *rcsid = "$Id: svc_run.c,v 1.1 1994/08/07 18:36:09 wollman Exp $"; +static char *rcsid = "$Id: svc_run.c,v 1.2 1995/05/30 05:41:35 rgrimes Exp $"; #endif /* @@ -38,7 +38,13 @@ static char *rcsid = "$Id: svc_run.c,v 1.1 1994/08/07 18:36:09 wollman Exp $"; * Wait for input, call server program. */ #include +#include #include +#include +#include +#include + +int _rpc_dtablesize(void); void svc_run() @@ -48,7 +54,6 @@ svc_run() #else int readfds; #endif /* def FD_SETSIZE */ - extern int errno; for (;;) { #ifdef FD_SETSIZE @@ -56,7 +61,7 @@ svc_run() #else readfds = svc_fds; #endif /* def FD_SETSIZE */ - switch (select(_rpc_dtablesize(), &readfds, (int *)0, (int *)0, + switch (select(_rpc_dtablesize(), &readfds, NULL, NULL, (struct timeval *)0)) { case -1: if (errno == EINTR) {