Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/rpc int -> socklen_t



details:   https://anonhg.NetBSD.org/src/rev/52623bf912df
branches:  trunk
changeset: 472607:52623bf912df
user:      christos <christos%NetBSD.org@localhost>
date:      Mon May 03 15:32:13 1999 +0000

description:
int -> socklen_t

diffstat:

 lib/libc/rpc/bindresvport.c |   9 +++++----
 lib/libc/rpc/clnt_udp.c     |   8 ++++----
 lib/libc/rpc/pmap_rmt.c     |   7 ++++---
 lib/libc/rpc/svc_tcp.c      |   8 ++++----
 lib/libc/rpc/svc_udp.c      |  15 ++++++++-------
 5 files changed, 25 insertions(+), 22 deletions(-)

diffs (202 lines):

diff -r 1eea07862ff9 -r 52623bf912df lib/libc/rpc/bindresvport.c
--- a/lib/libc/rpc/bindresvport.c       Mon May 03 15:26:49 1999 +0000
+++ b/lib/libc/rpc/bindresvport.c       Mon May 03 15:32:13 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bindresvport.c,v 1.14 1999/01/20 11:37:35 lukem Exp $  */
+/*     $NetBSD: bindresvport.c,v 1.15 1999/05/03 15:32:13 christos Exp $       */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)bindresvport.c 1.8 88/02/08 SMI";
 static char *sccsid = "@(#)bindresvport.c      2.2 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: bindresvport.c,v 1.14 1999/01/20 11:37:35 lukem Exp $");
+__RCSID("$NetBSD: bindresvport.c,v 1.15 1999/05/03 15:32:13 christos Exp $");
 #endif
 #endif
 
@@ -70,7 +70,7 @@
 {
        int res, old;
        struct sockaddr_in myaddr;
-       int sinlen = sizeof(struct sockaddr_in);
+       socklen_t sinlen = sizeof(struct sockaddr_in);
 
        if (sin == NULL) {
                sin = &myaddr;
@@ -83,7 +83,8 @@
        }
 
        if (sin->sin_port == 0) {
-               int on, oldlen = sizeof(old);
+               int on;
+               socklen_t oldlen = sizeof(old);
 
                res = getsockopt(sd, IPPROTO_IP, IP_PORTRANGE, &old, &oldlen);
                if (res < 0)
diff -r 1eea07862ff9 -r 52623bf912df lib/libc/rpc/clnt_udp.c
--- a/lib/libc/rpc/clnt_udp.c   Mon May 03 15:26:49 1999 +0000
+++ b/lib/libc/rpc/clnt_udp.c   Mon May 03 15:32:13 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clnt_udp.c,v 1.17 1999/03/25 01:16:11 lukem Exp $      */
+/*     $NetBSD: clnt_udp.c,v 1.18 1999/05/03 15:32:13 christos Exp $   */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)clnt_udp.c 1.39 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)clnt_udp.c  2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: clnt_udp.c,v 1.17 1999/03/25 01:16:11 lukem Exp $");
+__RCSID("$NetBSD: clnt_udp.c,v 1.18 1999/05/03 15:32:13 christos Exp $");
 #endif
 #endif
 
@@ -248,7 +248,7 @@
        XDR *xdrs;
        size_t outlen;
        int inlen;
-       int fromlen;
+       socklen_t fromlen;
        struct pollfd fd;
        int milliseconds = (int)((cu->cu_wait.tv_sec * 1000) +
            (cu->cu_wait.tv_usec / 1000));
@@ -284,7 +284,7 @@
 
 send_again:
        if (sendto(cu->cu_sock, cu->cu_outbuf, outlen, 0,
-           (struct sockaddr *)(void *)&(cu->cu_raddr), cu->cu_rlen)
+           (struct sockaddr *)(void *)&(cu->cu_raddr), (socklen_t)cu->cu_rlen)
            != outlen) {
                cu->cu_error.re_errno = errno;
                return (cu->cu_error.re_status = RPC_CANTSEND);
diff -r 1eea07862ff9 -r 52623bf912df lib/libc/rpc/pmap_rmt.c
--- a/lib/libc/rpc/pmap_rmt.c   Mon May 03 15:26:49 1999 +0000
+++ b/lib/libc/rpc/pmap_rmt.c   Mon May 03 15:32:13 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_rmt.c,v 1.20 1999/03/25 01:16:11 lukem Exp $      */
+/*     $NetBSD: pmap_rmt.c,v 1.21 1999/05/03 15:32:13 christos Exp $   */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)pmap_rmt.c  2.2 88/08/01 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: pmap_rmt.c,v 1.20 1999/03/25 01:16:11 lukem Exp $");
+__RCSID("$NetBSD: pmap_rmt.c,v 1.21 1999/05/03 15:32:13 christos Exp $");
 #endif
 #endif
 
@@ -255,7 +255,8 @@
        AUTH *unix_auth = authunix_create_default();
        XDR xdr_stream;
        XDR *xdrs = &xdr_stream;
-       int inlen, fromlen, nets;
+       int inlen, nets;
+       socklen_t fromlen;
        size_t outlen;
        int sock;
        int on = 1;
diff -r 1eea07862ff9 -r 52623bf912df lib/libc/rpc/svc_tcp.c
--- a/lib/libc/rpc/svc_tcp.c    Mon May 03 15:26:49 1999 +0000
+++ b/lib/libc/rpc/svc_tcp.c    Mon May 03 15:32:13 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svc_tcp.c,v 1.22 1999/03/25 01:16:11 lukem Exp $       */
+/*     $NetBSD: svc_tcp.c,v 1.23 1999/05/03 15:32:13 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_tcp.c,v 1.22 1999/03/25 01:16:11 lukem Exp $");
+__RCSID("$NetBSD: svc_tcp.c,v 1.23 1999/05/03 15:32:13 christos Exp $");
 #endif
 #endif
 
@@ -148,7 +148,7 @@
        SVCXPRT *xprt;
        struct tcp_rendezvous *r = NULL;
        struct sockaddr_in addr;
-       int len = sizeof(struct sockaddr_in);
+       socklen_t len = sizeof(struct sockaddr_in);
 
        if (sock == RPC_ANYSOCK) {
                if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
@@ -259,7 +259,7 @@
        int sock;
        struct tcp_rendezvous *r;
        struct sockaddr_in addr;
-       int len;
+       socklen_t len;
 
        r = (struct tcp_rendezvous *)xprt->xp_p1;
     again:
diff -r 1eea07862ff9 -r 52623bf912df lib/libc/rpc/svc_udp.c
--- a/lib/libc/rpc/svc_udp.c    Mon May 03 15:26:49 1999 +0000
+++ b/lib/libc/rpc/svc_udp.c    Mon May 03 15:32:13 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svc_udp.c,v 1.17 1999/03/25 01:16:11 lukem Exp $       */
+/*     $NetBSD: svc_udp.c,v 1.18 1999/05/03 15:32:13 christos Exp $    */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)svc_udp.c   2.2 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: svc_udp.c,v 1.17 1999/03/25 01:16:11 lukem Exp $");
+__RCSID("$NetBSD: svc_udp.c,v 1.18 1999/05/03 15:32:13 christos Exp $");
 #endif
 #endif
 
@@ -122,7 +122,7 @@
        SVCXPRT *xprt = NULL;
        struct svcudp_data *su = NULL;
        struct sockaddr_in addr;
-       int len = sizeof(struct sockaddr_in);
+       socklen_t len = sizeof(struct sockaddr_in);
 
        if (sock == RPC_ANYSOCK) {
                if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
@@ -204,16 +204,17 @@
        int rlen;
        char *reply;
        u_long replylen;
+       socklen_t alen;
 
     again:
        xprt->xp_addrlen = sizeof(struct sockaddr_in);
        rlen = recvfrom(xprt->xp_sock, rpc_buffer(xprt), su->su_iosz,
-           0, (struct sockaddr *)(void *)&(xprt->xp_raddr),
-           &(xprt->xp_addrlen));
+           0, (struct sockaddr *)(void *)&(xprt->xp_raddr), &alen);
        if (rlen == -1 && errno == EINTR)
                goto again;
        if (rlen == -1 || rlen < 4*sizeof(u_int32_t))
                return (FALSE);
+       xprt->xp_addrlen = alen;
        xdrs->x_op = XDR_DECODE;
        XDR_SETPOS(xdrs, 0);
        if (! xdr_callmsg(xdrs, msg))
@@ -224,7 +225,7 @@
                        (void) sendto(xprt->xp_sock, reply,
                            (u_int32_t)replylen, 0,
                            (struct sockaddr *)(void *)&xprt->xp_raddr,
-                           xprt->xp_addrlen);
+                           (socklen_t)xprt->xp_addrlen);
                        return (TRUE);
                }
        }
@@ -248,7 +249,7 @@
                slen = XDR_GETPOS(xdrs);
                if (sendto(xprt->xp_sock, rpc_buffer(xprt), slen, 0,
                    (struct sockaddr *)(void *)&(xprt->xp_raddr),
-                   xprt->xp_addrlen) == slen) {
+                   (socklen_t)xprt->xp_addrlen) == slen) {
                        stat = TRUE;
                        if (su->su_cache) {
                                cache_set(xprt, (u_long) slen);



Home | Main Index | Thread Index | Old Index