From f18da82e6905c4c6b2a7dbc275eaca205a7fc8ec Mon Sep 17 00:00:00 2001 From: lukem Date: Tue, 10 Feb 1998 06:32:42 +0000 Subject: [PATCH] use u_int32_t instead of u_long --- lib/librpcsvc/rnusers.x | 16 ++++++++-------- usr.sbin/ypbind/ypbind.c | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/librpcsvc/rnusers.x b/lib/librpcsvc/rnusers.x index 42a17becf42f..393d63f1522b 100644 --- a/lib/librpcsvc/rnusers.x +++ b/lib/librpcsvc/rnusers.x @@ -36,7 +36,7 @@ %#ifndef lint %/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/ %/*static char sccsid[] = "from: @(#)rnusers.x 2.1 88/08/01 4.0 RPCSRC";*/ -%__RCSID("$NetBSD: rnusers.x,v 1.6 1997/10/09 15:45:15 mycroft Exp $"); +%__RCSID("$NetBSD: rnusers.x,v 1.7 1998/02/10 06:32:42 lukem Exp $"); %#endif /* not lint */ #endif @@ -59,7 +59,7 @@ % char ut_line[8]; /* tty name */ % char ut_name[8]; /* user id */ % char ut_host[16]; /* host name, if remote */ -% long ut_time; /* time on */ +% time_t ut_time; /* time on */ %}; %typedef struct ru_utmp rutmp; % @@ -90,19 +90,19 @@ %bool_t xdr_utmpidlearr __P((XDR *, struct utmpidlearr *)); %__END_DECLS % -%#define RUSERSVERS_1 ((u_long)1) -%#define RUSERSVERS_2 ((u_long)2) +%#define RUSERSVERS_1 ((u_int32_t)1) +%#define RUSERSVERS_2 ((u_int32_t)2) %#ifndef RUSERSPROG -%#define RUSERSPROG ((u_long)100002) +%#define RUSERSPROG ((u_int32_t)100002) %#endif %#ifndef RUSERSPROC_NUM -%#define RUSERSPROC_NUM ((u_long)1) +%#define RUSERSPROC_NUM ((u_int32_t)1) %#endif %#ifndef RUSERSPROC_NAMES -%#define RUSERSPROC_NAMES ((u_long)2) +%#define RUSERSPROC_NAMES ((u_int32_t)2) %#endif %#ifndef RUSERSPROC_ALLNAMES -%#define RUSERSPROC_ALLNAMES ((u_long)3) +%#define RUSERSPROC_ALLNAMES ((u_int32_t)3) %#endif % #endif /* RPC_HDR */ diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c index 516affa64283..d2d9eabf7800 100644 --- a/usr.sbin/ypbind/ypbind.c +++ b/usr.sbin/ypbind/ypbind.c @@ -1,4 +1,4 @@ -/* $NetBSD: ypbind.c,v 1.33 1997/07/18 23:08:45 thorpej Exp $ */ +/* $NetBSD: ypbind.c,v 1.34 1998/02/10 06:41:00 lukem Exp $ */ /* * Copyright (c) 1992, 1993 Theo de Raadt @@ -34,7 +34,7 @@ #include #ifndef LINT -__RCSID("$NetBSD: ypbind.c,v 1.33 1997/07/18 23:08:45 thorpej Exp $"); +__RCSID("$NetBSD: ypbind.c,v 1.34 1998/02/10 06:41:00 lukem Exp $"); #endif #include @@ -82,10 +82,10 @@ struct _dom_binding { struct _dom_binding *dom_pnext; char dom_domain[YPMAXDOMAIN + 1]; struct sockaddr_in dom_server_addr; - unsigned short int dom_server_port; + in_port_t dom_server_port; int dom_socket; CLIENT *dom_client; - long dom_vers; + u_int32_t dom_vers; time_t dom_check_t; time_t dom_ask_t; int dom_lockfd; @@ -120,7 +120,7 @@ static int rpcsock, pingsock; static struct rmtcallargs rmtca; static struct rmtcallres rmtcr; static bool_t rmtcr_outval; -static u_long rmtcr_port; +static u_int32_t rmtcr_port; static SVCXPRT *udptransp, *tcptransp; int _yp_invalid_domain __P((const char *)); /* from libc */ @@ -182,7 +182,7 @@ makelock(ypdb) int fd; char path[MAXPATHLEN]; - (void) snprintf(path, sizeof(path), "%s/%s.%ld", BINDINGDIR, + (void) snprintf(path, sizeof(path), "%s/%s.%d", BINDINGDIR, ypdb->dom_domain, ypdb->dom_vers); if ((fd = open(path, O_CREAT|O_SHLOCK|O_RDWR|O_TRUNC, 0644)) == -1) { @@ -203,7 +203,7 @@ removelock(ypdb) { char path[MAXPATHLEN]; - (void) snprintf(path, sizeof(path), "%s/%s.%ld", + (void) snprintf(path, sizeof(path), "%s/%s.%d", BINDINGDIR, ypdb->dom_domain, ypdb->dom_vers); (void) unlink(path); } @@ -948,7 +948,7 @@ direct_set(buf, outlen, ypdb) * "been_set" if this happens, otherwise we'll never * bind again. */ - snprintf(path, sizeof(path), "%s/%s.%ld", BINDINGDIR, + snprintf(path, sizeof(path), "%s/%s.%d", BINDINGDIR, ypdb->dom_domain, ypdb->dom_vers); if ((fd = open(path, O_SHLOCK|O_RDONLY, 0644)) == -1) { @@ -1024,7 +1024,7 @@ try_again: if (xdr_replymsg(&xdr, &msg)) { if ((msg.rm_reply.rp_stat == MSG_ACCEPTED) && (msg.acpted_rply.ar_stat == SUCCESS)) { - raddr.sin_port = htons((u_short)rmtcr_port); + raddr.sin_port = htons((in_port_t)rmtcr_port); ypdb = xid2ypdb(msg.rm_xid); if (ypdb != NULL) rpc_received(ypdb->dom_domain, &raddr, 0); @@ -1199,7 +1199,7 @@ unique_xid(ypdb) { u_int32_t tmp_xid; - tmp_xid = (u_int32_t)(((u_long)ypdb) & 0xffffffff); + tmp_xid = (u_int32_t)(((u_int32_t)ypdb) & 0xffffffff); while (xid2ypdb(tmp_xid) != NULL) tmp_xid++;