summaryrefslogtreecommitdiffstats
path: root/libc/inet/rpc/rtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/inet/rpc/rtime.c')
-rw-r--r--libc/inet/rpc/rtime.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libc/inet/rpc/rtime.c b/libc/inet/rpc/rtime.c
index fc4cfe548..6190868ad 100644
--- a/libc/inet/rpc/rtime.c
+++ b/libc/inet/rpc/rtime.c
@@ -1,3 +1,6 @@
+#if 0
+static char sccsid[] = "@(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 SMI";
+#endif
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
* unrestricted use provided that this legend is included on all tape
@@ -26,9 +29,6 @@
* 2550 Garcia Avenue
* Mountain View, California 94043
*/
-#if 0
-static char sccsid[] = "@(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 SMI";
-#endif
/*
* Copyright (c) 1988 by Sun Microsystems, Inc.
@@ -65,6 +65,7 @@ libc_hidden_proto(connect)
libc_hidden_proto(recvfrom)
libc_hidden_proto(sendto)
libc_hidden_proto(poll)
+libc_hidden_proto(rtime)
#define NYEARS (u_long)(1970 - 1900)
#define TOFFSET (u_long)(60*60*24*(365*NYEARS + (NYEARS/4)))
@@ -89,9 +90,10 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
struct pollfd fd;
int milliseconds;
int res;
- unsigned long thetime;
+ /* RFC 868 says the time is transmitted as a 32-bit value. */
+ uint32_t thetime;
struct sockaddr_in from;
- int fromlen;
+ socklen_t fromlen;
int type;
if (timeout == NULL)
@@ -108,7 +110,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
if (type == SOCK_DGRAM)
{
res = sendto (s, (char *) &thetime, sizeof (thetime), 0,
- (struct sockaddr *) addrp, sizeof (*addrp));
+ (struct sockaddr *) addrp, sizeof (*addrp));
if (res < 0)
{
do_close (s);
@@ -129,7 +131,7 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
}
fromlen = sizeof (from);
res = recvfrom (s, (char *) &thetime, sizeof (thetime), 0,
- (struct sockaddr *) &from, &fromlen);
+ (struct sockaddr *) &from, &fromlen);
do_close (s);
if (res < 0)
return -1;
@@ -156,3 +158,4 @@ rtime (struct sockaddr_in *addrp, struct rpc_timeval *timep,
timep->tv_usec = 0;
return 0;
}
+libc_hidden_def (rtime)