summaryrefslogtreecommitdiffstats
path: root/c/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2000-10-31 16:39:06 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2000-10-31 16:39:06 +0000
commit57cfaad2f5cb97a66c3353cf11f62c39dd0b5ea9 (patch)
tree4cd6e89ca949ddcda7c0438f4860abfefca8bc7a /c/src
parent3e597933ff58732e09d4d1ce5bd02d39737cb8c8 (diff)
downloadrtems-57cfaad2f5cb97a66c3353cf11f62c39dd0b5ea9.tar.bz2
2000-10-30 Joel Sherrill <joel@OARcorp.com>
* POSIX include files merged into newlib. This resulted in some definitions moving to other files and thus some secondary effects in RTEMS source code. * src/rpc/Makefile.am, src/rpc/auth_time.c, src/rpc/clnt_simple.c, src/rpc/clnt_tcp.c, src/rpc/clnt_udp.c, src/rpc/clnt_unix.c, src/rpc/get_myaddress.c, src/rpc/pmap_clnt.c, src/rpc/pmap_getmaps.c, src/rpc/pmap_getport.c, src/rpc/pmap_rmt.c, src/rpc/rtime.c, src/rpc/svc_tcp.c, src/rpc/svc_udp.c, src/rpc/svc_unix.c: Use of _read, _write, and _close as macros conflicted with newlib's use of these as routine names. They were renamed to include "_RPC_" prefix.
Diffstat (limited to '')
-rw-r--r--c/src/exec/librpc/ChangeLog14
-rw-r--r--c/src/exec/librpc/src/rpc/Makefile.am2
-rw-r--r--c/src/exec/librpc/src/rpc/auth_time.c6
-rw-r--r--c/src/exec/librpc/src/rpc/clnt_simple.c2
-rw-r--r--c/src/exec/librpc/src/rpc/clnt_tcp.c10
-rw-r--r--c/src/exec/librpc/src/rpc/clnt_udp.c2
-rw-r--r--c/src/exec/librpc/src/rpc/clnt_unix.c6
-rw-r--r--c/src/exec/librpc/src/rpc/get_myaddress.c6
-rw-r--r--c/src/exec/librpc/src/rpc/pmap_clnt.c4
-rw-r--r--c/src/exec/librpc/src/rpc/pmap_getmaps.c2
-rw-r--r--c/src/exec/librpc/src/rpc/pmap_getport.c2
-rw-r--r--c/src/exec/librpc/src/rpc/pmap_rmt.c4
-rw-r--r--c/src/exec/librpc/src/rpc/rtime.c4
-rw-r--r--c/src/exec/librpc/src/rpc/svc_tcp.c14
-rw-r--r--c/src/exec/librpc/src/rpc/svc_udp.c4
-rw-r--r--c/src/exec/librpc/src/rpc/svc_unix.c4
-rw-r--r--c/src/librpc/ChangeLog14
-rw-r--r--c/src/librpc/src/rpc/Makefile.am2
-rw-r--r--c/src/librpc/src/rpc/auth_time.c6
-rw-r--r--c/src/librpc/src/rpc/clnt_simple.c2
-rw-r--r--c/src/librpc/src/rpc/clnt_tcp.c10
-rw-r--r--c/src/librpc/src/rpc/clnt_udp.c2
-rw-r--r--c/src/librpc/src/rpc/clnt_unix.c6
-rw-r--r--c/src/librpc/src/rpc/get_myaddress.c6
-rw-r--r--c/src/librpc/src/rpc/pmap_clnt.c4
-rw-r--r--c/src/librpc/src/rpc/pmap_getmaps.c2
-rw-r--r--c/src/librpc/src/rpc/pmap_getport.c2
-rw-r--r--c/src/librpc/src/rpc/pmap_rmt.c4
-rw-r--r--c/src/librpc/src/rpc/rtime.c4
-rw-r--r--c/src/librpc/src/rpc/svc_tcp.c14
-rw-r--r--c/src/librpc/src/rpc/svc_udp.c4
-rw-r--r--c/src/librpc/src/rpc/svc_unix.c4
32 files changed, 100 insertions, 72 deletions
diff --git a/c/src/exec/librpc/ChangeLog b/c/src/exec/librpc/ChangeLog
index 5f520da1af..fa260c8e60 100644
--- a/c/src/exec/librpc/ChangeLog
+++ b/c/src/exec/librpc/ChangeLog
@@ -1,3 +1,17 @@
+2000-10-30 Joel Sherrill <joel@OARcorp.com>
+
+ * POSIX include files merged into newlib. This resulted in
+ some definitions moving to other files and thus some secondary
+ effects in RTEMS source code.
+ * src/rpc/Makefile.am, src/rpc/auth_time.c, src/rpc/clnt_simple.c,
+ src/rpc/clnt_tcp.c, src/rpc/clnt_udp.c, src/rpc/clnt_unix.c,
+ src/rpc/get_myaddress.c, src/rpc/pmap_clnt.c, src/rpc/pmap_getmaps.c,
+ src/rpc/pmap_getport.c, src/rpc/pmap_rmt.c, src/rpc/rtime.c,
+ src/rpc/svc_tcp.c, src/rpc/svc_udp.c, src/rpc/svc_unix.c:
+ Use of _read, _write, and _close as macros conflicted with
+ newlib's use of these as routine names. They were renamed to
+ include "_RPC_" prefix.
+
2000-10-25 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
diff --git a/c/src/exec/librpc/src/rpc/Makefile.am b/c/src/exec/librpc/src/rpc/Makefile.am
index 2d2dc10a6a..f727bafc77 100644
--- a/c/src/exec/librpc/src/rpc/Makefile.am
+++ b/c/src/exec/librpc/src/rpc/Makefile.am
@@ -34,7 +34,7 @@ TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/$(LIBNAME)$(LIB_VARIANT).a
# Add local stuff here using +=
#
-AM_CPPFLAGS += '-D__P(x)=x' -D_read=read -D_write=write -D_close=close -D_RTEMS_RPC_INTERNAL_
+AM_CPPFLAGS += '-D__P(x)=x' -D_RPC_read=read -D_RPC_write=write -D_RPC_close=close -D_RTEMS_RPC_INTERNAL_
$(LIB): $(OBJS)
$(make-library)
diff --git a/c/src/exec/librpc/src/rpc/auth_time.c b/c/src/exec/librpc/src/rpc/auth_time.c
index 733080a397..ab3277c4df 100644
--- a/c/src/exec/librpc/src/rpc/auth_time.c
+++ b/c/src/exec/librpc/src/rpc/auth_time.c
@@ -437,7 +437,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
msg("alarm caught it, must be unreachable.");
goto error;
}
- res = _read(s, (char *)&thetime, sizeof(thetime));
+ res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
if (res != sizeof(thetime)) {
if (saw_alarm)
msg("timed out TCP call.");
@@ -449,7 +449,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
time_valid = 1;
}
save = errno;
- (void)_close(s);
+ (void)_RPC_close(s);
errno = save;
s = RPC_ANYSOCK;
@@ -468,7 +468,7 @@ error:
*/
if (s != RPC_ANYSOCK)
- (void)_close(s);
+ (void)_RPC_close(s);
if (clnt != NULL)
clnt_destroy(clnt);
diff --git a/c/src/exec/librpc/src/rpc/clnt_simple.c b/c/src/exec/librpc/src/rpc/clnt_simple.c
index e8f92bc657..cab68fda29 100644
--- a/c/src/exec/librpc/src/rpc/clnt_simple.c
+++ b/c/src/exec/librpc/src/rpc/clnt_simple.c
@@ -87,7 +87,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
} else {
crp->valid = 0;
if (crp->socket != -1)
- (void)_close(crp->socket);
+ (void)_RPC_close(crp->socket);
crp->socket = RPC_ANYSOCK;
if (crp->client) {
clnt_destroy(crp->client);
diff --git a/c/src/exec/librpc/src/rpc/clnt_tcp.c b/c/src/exec/librpc/src/rpc/clnt_tcp.c
index 2b094126b3..37c7a69fda 100644
--- a/c/src/exec/librpc/src/rpc/clnt_tcp.c
+++ b/c/src/exec/librpc/src/rpc/clnt_tcp.c
@@ -167,7 +167,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
if (*sockp != -1)
- (void)_close(*sockp);
+ (void)_RPC_close(*sockp);
goto fooy;
}
ct->ct_closeit = TRUE;
@@ -200,7 +200,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
XDR_ENCODE);
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
if (ct->ct_closeit) {
- (void)_close(*sockp);
+ (void)_RPC_close(*sockp);
}
goto fooy;
}
@@ -474,7 +474,7 @@ clnttcp_destroy(h)
(struct ct_data *) h->cl_private;
if (ct->ct_closeit) {
- (void)_close(ct->ct_sock);
+ (void)_RPC_close(ct->ct_sock);
}
XDR_DESTROY(&(ct->ct_xdrs));
mem_free((caddr_t)ct, sizeof(struct ct_data));
@@ -544,7 +544,7 @@ readtcp(ct, buf, len)
}
break;
}
- switch (len = _read(ct->ct_sock, buf, len)) {
+ switch (len = _RPC_read(ct->ct_sock, buf, len)) {
case 0:
/* premature eof */
@@ -570,7 +570,7 @@ writetcp(ct, buf, len)
register int i, cnt;
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
- if ((i = _write(ct->ct_sock, buf, cnt)) == -1) {
+ if ((i = _RPC_write(ct->ct_sock, buf, cnt)) == -1) {
ct->ct_error.re_errno = errno;
ct->ct_error.re_status = RPC_CANTSEND;
return (-1);
diff --git a/c/src/exec/librpc/src/rpc/clnt_udp.c b/c/src/exec/librpc/src/rpc/clnt_udp.c
index 304d451d64..b9ead1c56a 100644
--- a/c/src/exec/librpc/src/rpc/clnt_udp.c
+++ b/c/src/exec/librpc/src/rpc/clnt_udp.c
@@ -559,7 +559,7 @@ clntudp_destroy(cl)
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
if (cu->cu_closeit) {
- (void)_close(cu->cu_sock);
+ (void)_RPC_close(cu->cu_sock);
}
XDR_DESTROY(&(cu->cu_outxdrs));
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
diff --git a/c/src/exec/librpc/src/rpc/clnt_unix.c b/c/src/exec/librpc/src/rpc/clnt_unix.c
index 1107bc3e15..0cfe988595 100644
--- a/c/src/exec/librpc/src/rpc/clnt_unix.c
+++ b/c/src/exec/librpc/src/rpc/clnt_unix.c
@@ -158,7 +158,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
if (*sockp != -1)
- (void)_close(*sockp);
+ (void)_RPC_close(*sockp);
goto fooy;
}
ct->ct_closeit = TRUE;
@@ -191,7 +191,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
XDR_ENCODE);
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
if (ct->ct_closeit) {
- (void)_close(*sockp);
+ (void)_RPC_close(*sockp);
}
goto fooy;
}
@@ -465,7 +465,7 @@ clntunix_destroy(h)
(struct ct_data *) h->cl_private;
if (ct->ct_closeit) {
- (void)_close(ct->ct_sock);
+ (void)_RPC_close(ct->ct_sock);
}
XDR_DESTROY(&(ct->ct_xdrs));
mem_free((caddr_t)ct, sizeof(struct ct_data));
diff --git a/c/src/exec/librpc/src/rpc/get_myaddress.c b/c/src/exec/librpc/src/rpc/get_myaddress.c
index c636ea2be9..8e951f559e 100644
--- a/c/src/exec/librpc/src/rpc/get_myaddress.c
+++ b/c/src/exec/librpc/src/rpc/get_myaddress.c
@@ -73,7 +73,7 @@ get_myaddress(addr)
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
- _close(s);
+ _RPC_close(s);
return(-1);
}
again:
@@ -83,7 +83,7 @@ again:
while (ifr < end) {
ifreq = *ifr;
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
- _close(s);
+ _RPC_close(s);
return(-1);
}
if (((ifreq.ifr_flags & IFF_UP) &&
@@ -107,6 +107,6 @@ again:
loopback = 1;
goto again;
}
- (void)_close(s);
+ (void)_RPC_close(s);
return (gotit ? 0 : -1);
}
diff --git a/c/src/exec/librpc/src/rpc/pmap_clnt.c b/c/src/exec/librpc/src/rpc/pmap_clnt.c
index 955748ba10..469e65b233 100644
--- a/c/src/exec/librpc/src/rpc/pmap_clnt.c
+++ b/c/src/exec/librpc/src/rpc/pmap_clnt.c
@@ -102,7 +102,7 @@ pmap_set(program, version, protocol, port)
}
CLNT_DESTROY(client);
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
return (rslt);
}
@@ -144,6 +144,6 @@ pmap_unset(program, version)
tottimeout);
CLNT_DESTROY(client);
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
return (rslt);
}
diff --git a/c/src/exec/librpc/src/rpc/pmap_getmaps.c b/c/src/exec/librpc/src/rpc/pmap_getmaps.c
index 138e07c798..3a5f6aa16e 100644
--- a/c/src/exec/librpc/src/rpc/pmap_getmaps.c
+++ b/c/src/exec/librpc/src/rpc/pmap_getmaps.c
@@ -80,7 +80,7 @@ pmap_getmaps(address)
CLNT_DESTROY(client);
}
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
address->sin_port = 0;
return (head);
}
diff --git a/c/src/exec/librpc/src/rpc/pmap_getport.c b/c/src/exec/librpc/src/rpc/pmap_getport.c
index 13b6a8bbcc..4029f1e5b9 100644
--- a/c/src/exec/librpc/src/rpc/pmap_getport.c
+++ b/c/src/exec/librpc/src/rpc/pmap_getport.c
@@ -85,7 +85,7 @@ pmap_getport(address, program, version, protocol)
CLNT_DESTROY(client);
}
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
address->sin_port = 0;
return (port);
}
diff --git a/c/src/exec/librpc/src/rpc/pmap_rmt.c b/c/src/exec/librpc/src/rpc/pmap_rmt.c
index 822293a00c..cb04941415 100644
--- a/c/src/exec/librpc/src/rpc/pmap_rmt.c
+++ b/c/src/exec/librpc/src/rpc/pmap_rmt.c
@@ -98,7 +98,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
stat = RPC_FAILED;
}
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
addr->sin_port = 0;
return (stat);
}
@@ -408,7 +408,7 @@ done_broad:
if (fds != &readfds)
free(fds);
if (sock >= 0)
- (void)_close(sock);
+ (void)_RPC_close(sock);
AUTH_DESTROY(unix_auth);
return (stat);
}
diff --git a/c/src/exec/librpc/src/rpc/rtime.c b/c/src/exec/librpc/src/rpc/rtime.c
index b37d6bdb52..ad83dee2dc 100644
--- a/c/src/exec/librpc/src/rpc/rtime.c
+++ b/c/src/exec/librpc/src/rpc/rtime.c
@@ -129,7 +129,7 @@ rtime(addrp, timep, timeout)
do_close(s);
return(-1);
}
- res = _read(s, (char *)&thetime, sizeof(thetime));
+ res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
do_close(s);
if (res < 0) {
return(-1);
@@ -152,6 +152,6 @@ do_close(s)
int save;
save = errno;
- (void)_close(s);
+ (void)_RPC_close(s);
errno = save;
}
diff --git a/c/src/exec/librpc/src/rpc/svc_tcp.c b/c/src/exec/librpc/src/rpc/svc_tcp.c
index 81ae27bead..0c2133a049 100644
--- a/c/src/exec/librpc/src/rpc/svc_tcp.c
+++ b/c/src/exec/librpc/src/rpc/svc_tcp.c
@@ -145,7 +145,7 @@ svctcp_create(sock, sendsize, recvsize)
if (ioctl(sock, FIONBIO, &on) < 0) {
perror("svc_tcp.c - cannot turn on non-blocking mode");
if (madesock)
- (void)_close(sock);
+ (void)_RPC_close(sock);
return ((SVCXPRT *)NULL);
}
memset(&addr, 0, sizeof (addr));
@@ -159,7 +159,7 @@ svctcp_create(sock, sendsize, recvsize)
(listen(sock, 2) != 0)) {
perror("svctcp_.c - cannot getsockname or listen");
if (madesock)
- (void)_close(sock);
+ (void)_RPC_close(sock);
return ((SVCXPRT *)NULL);
}
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
@@ -257,7 +257,7 @@ rendezvous_request(xprt)
* Guard against FTP bounce attacks.
*/
if (addr.sin_port == htons(20)) {
- _close(sock);
+ _RPC_close(sock);
return (FALSE);
}
/*
@@ -265,7 +265,7 @@ rendezvous_request(xprt)
*/
off = 0;
if (ioctl(sock, FIONBIO, &off) < 0) {
- _close(sock);
+ _RPC_close(sock);
return (FALSE);
}
/*
@@ -291,7 +291,7 @@ svctcp_destroy(xprt)
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
xprt_unregister(xprt);
- (void)_close(xprt->xp_sock);
+ (void)_RPC_close(xprt->xp_sock);
if (xprt->xp_port != 0) {
/* a rendezvouser socket */
xprt->xp_port = 0;
@@ -373,7 +373,7 @@ readtcp(xprt, buf, len)
}
}
} while (!FD_ISSET(sock, fds));
- if ((len = _read(sock, buf, len)) > 0) {
+ if ((len = _RPC_read(sock, buf, len)) > 0) {
if (fds != NULL)
free(fds);
return (len);
@@ -398,7 +398,7 @@ writetcp(xprt, buf, len)
register int i, cnt;
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
- if ((i = _write(xprt->xp_sock, buf, cnt)) < 0) {
+ if ((i = _RPC_write(xprt->xp_sock, buf, cnt)) < 0) {
((struct tcp_conn *)(xprt->xp_p1))->strm_stat =
XPRT_DIED;
return (-1);
diff --git a/c/src/exec/librpc/src/rpc/svc_udp.c b/c/src/exec/librpc/src/rpc/svc_udp.c
index e5d90a184f..652683b3da 100644
--- a/c/src/exec/librpc/src/rpc/svc_udp.c
+++ b/c/src/exec/librpc/src/rpc/svc_udp.c
@@ -123,7 +123,7 @@ svcudp_bufcreate(sock, sendsz, recvsz)
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
perror("svcudp_create - cannot getsockname");
if (madesock)
- (void)_close(sock);
+ (void)_RPC_close(sock);
return ((SVCXPRT *)NULL);
}
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
@@ -259,7 +259,7 @@ svcudp_destroy(xprt)
register struct svcudp_data *su = su_data(xprt);
xprt_unregister(xprt);
- (void)_close(xprt->xp_sock);
+ (void)_RPC_close(xprt->xp_sock);
XDR_DESTROY(&(su->su_xdrs));
mem_free(rpc_buffer(xprt), su->su_iosz);
mem_free((caddr_t)su, sizeof(struct svcudp_data));
diff --git a/c/src/exec/librpc/src/rpc/svc_unix.c b/c/src/exec/librpc/src/rpc/svc_unix.c
index b0f3175c0e..53772ecd4a 100644
--- a/c/src/exec/librpc/src/rpc/svc_unix.c
+++ b/c/src/exec/librpc/src/rpc/svc_unix.c
@@ -213,7 +213,7 @@ svcunix_create(sock, sendsize, recvsize, path)
(listen(sock, 2) != 0)) {
perror("svc_unix.c - cannot getsockname or listen");
if (madesock)
- (void)_close(sock);
+ (void)_RPC_close(sock);
return ((SVCXPRT *)NULL);
}
r = (struct unix_rendezvous *)mem_alloc(sizeof(*r));
@@ -333,7 +333,7 @@ svcunix_destroy(xprt)
register struct unix_conn *cd = (struct unix_conn *)xprt->xp_p1;
xprt_unregister(xprt);
- (void)_close(xprt->xp_sock);
+ (void)_RPC_close(xprt->xp_sock);
if (xprt->xp_port != 0) {
/* a rendezvouser socket */
xprt->xp_port = 0;
diff --git a/c/src/librpc/ChangeLog b/c/src/librpc/ChangeLog
index 5f520da1af..fa260c8e60 100644
--- a/c/src/librpc/ChangeLog
+++ b/c/src/librpc/ChangeLog
@@ -1,3 +1,17 @@
+2000-10-30 Joel Sherrill <joel@OARcorp.com>
+
+ * POSIX include files merged into newlib. This resulted in
+ some definitions moving to other files and thus some secondary
+ effects in RTEMS source code.
+ * src/rpc/Makefile.am, src/rpc/auth_time.c, src/rpc/clnt_simple.c,
+ src/rpc/clnt_tcp.c, src/rpc/clnt_udp.c, src/rpc/clnt_unix.c,
+ src/rpc/get_myaddress.c, src/rpc/pmap_clnt.c, src/rpc/pmap_getmaps.c,
+ src/rpc/pmap_getport.c, src/rpc/pmap_rmt.c, src/rpc/rtime.c,
+ src/rpc/svc_tcp.c, src/rpc/svc_udp.c, src/rpc/svc_unix.c:
+ Use of _read, _write, and _close as macros conflicted with
+ newlib's use of these as routine names. They were renamed to
+ include "_RPC_" prefix.
+
2000-10-25 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
diff --git a/c/src/librpc/src/rpc/Makefile.am b/c/src/librpc/src/rpc/Makefile.am
index 2d2dc10a6a..f727bafc77 100644
--- a/c/src/librpc/src/rpc/Makefile.am
+++ b/c/src/librpc/src/rpc/Makefile.am
@@ -34,7 +34,7 @@ TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/$(LIBNAME)$(LIB_VARIANT).a
# Add local stuff here using +=
#
-AM_CPPFLAGS += '-D__P(x)=x' -D_read=read -D_write=write -D_close=close -D_RTEMS_RPC_INTERNAL_
+AM_CPPFLAGS += '-D__P(x)=x' -D_RPC_read=read -D_RPC_write=write -D_RPC_close=close -D_RTEMS_RPC_INTERNAL_
$(LIB): $(OBJS)
$(make-library)
diff --git a/c/src/librpc/src/rpc/auth_time.c b/c/src/librpc/src/rpc/auth_time.c
index 733080a397..ab3277c4df 100644
--- a/c/src/librpc/src/rpc/auth_time.c
+++ b/c/src/librpc/src/rpc/auth_time.c
@@ -437,7 +437,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
msg("alarm caught it, must be unreachable.");
goto error;
}
- res = _read(s, (char *)&thetime, sizeof(thetime));
+ res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
if (res != sizeof(thetime)) {
if (saw_alarm)
msg("timed out TCP call.");
@@ -449,7 +449,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
time_valid = 1;
}
save = errno;
- (void)_close(s);
+ (void)_RPC_close(s);
errno = save;
s = RPC_ANYSOCK;
@@ -468,7 +468,7 @@ error:
*/
if (s != RPC_ANYSOCK)
- (void)_close(s);
+ (void)_RPC_close(s);
if (clnt != NULL)
clnt_destroy(clnt);
diff --git a/c/src/librpc/src/rpc/clnt_simple.c b/c/src/librpc/src/rpc/clnt_simple.c
index e8f92bc657..cab68fda29 100644
--- a/c/src/librpc/src/rpc/clnt_simple.c
+++ b/c/src/librpc/src/rpc/clnt_simple.c
@@ -87,7 +87,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
} else {
crp->valid = 0;
if (crp->socket != -1)
- (void)_close(crp->socket);
+ (void)_RPC_close(crp->socket);
crp->socket = RPC_ANYSOCK;
if (crp->client) {
clnt_destroy(crp->client);
diff --git a/c/src/librpc/src/rpc/clnt_tcp.c b/c/src/librpc/src/rpc/clnt_tcp.c
index 2b094126b3..37c7a69fda 100644
--- a/c/src/librpc/src/rpc/clnt_tcp.c
+++ b/c/src/librpc/src/rpc/clnt_tcp.c
@@ -167,7 +167,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
if (*sockp != -1)
- (void)_close(*sockp);
+ (void)_RPC_close(*sockp);
goto fooy;
}
ct->ct_closeit = TRUE;
@@ -200,7 +200,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
XDR_ENCODE);
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
if (ct->ct_closeit) {
- (void)_close(*sockp);
+ (void)_RPC_close(*sockp);
}
goto fooy;
}
@@ -474,7 +474,7 @@ clnttcp_destroy(h)
(struct ct_data *) h->cl_private;
if (ct->ct_closeit) {
- (void)_close(ct->ct_sock);
+ (void)_RPC_close(ct->ct_sock);
}
XDR_DESTROY(&(ct->ct_xdrs));
mem_free((caddr_t)ct, sizeof(struct ct_data));
@@ -544,7 +544,7 @@ readtcp(ct, buf, len)
}
break;
}
- switch (len = _read(ct->ct_sock, buf, len)) {
+ switch (len = _RPC_read(ct->ct_sock, buf, len)) {
case 0:
/* premature eof */
@@ -570,7 +570,7 @@ writetcp(ct, buf, len)
register int i, cnt;
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
- if ((i = _write(ct->ct_sock, buf, cnt)) == -1) {
+ if ((i = _RPC_write(ct->ct_sock, buf, cnt)) == -1) {
ct->ct_error.re_errno = errno;
ct->ct_error.re_status = RPC_CANTSEND;
return (-1);
diff --git a/c/src/librpc/src/rpc/clnt_udp.c b/c/src/librpc/src/rpc/clnt_udp.c
index 304d451d64..b9ead1c56a 100644
--- a/c/src/librpc/src/rpc/clnt_udp.c
+++ b/c/src/librpc/src/rpc/clnt_udp.c
@@ -559,7 +559,7 @@ clntudp_destroy(cl)
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
if (cu->cu_closeit) {
- (void)_close(cu->cu_sock);
+ (void)_RPC_close(cu->cu_sock);
}
XDR_DESTROY(&(cu->cu_outxdrs));
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
diff --git a/c/src/librpc/src/rpc/clnt_unix.c b/c/src/librpc/src/rpc/clnt_unix.c
index 1107bc3e15..0cfe988595 100644
--- a/c/src/librpc/src/rpc/clnt_unix.c
+++ b/c/src/librpc/src/rpc/clnt_unix.c
@@ -158,7 +158,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_errno = errno;
if (*sockp != -1)
- (void)_close(*sockp);
+ (void)_RPC_close(*sockp);
goto fooy;
}
ct->ct_closeit = TRUE;
@@ -191,7 +191,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
XDR_ENCODE);
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
if (ct->ct_closeit) {
- (void)_close(*sockp);
+ (void)_RPC_close(*sockp);
}
goto fooy;
}
@@ -465,7 +465,7 @@ clntunix_destroy(h)
(struct ct_data *) h->cl_private;
if (ct->ct_closeit) {
- (void)_close(ct->ct_sock);
+ (void)_RPC_close(ct->ct_sock);
}
XDR_DESTROY(&(ct->ct_xdrs));
mem_free((caddr_t)ct, sizeof(struct ct_data));
diff --git a/c/src/librpc/src/rpc/get_myaddress.c b/c/src/librpc/src/rpc/get_myaddress.c
index c636ea2be9..8e951f559e 100644
--- a/c/src/librpc/src/rpc/get_myaddress.c
+++ b/c/src/librpc/src/rpc/get_myaddress.c
@@ -73,7 +73,7 @@ get_myaddress(addr)
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
- _close(s);
+ _RPC_close(s);
return(-1);
}
again:
@@ -83,7 +83,7 @@ again:
while (ifr < end) {
ifreq = *ifr;
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
- _close(s);
+ _RPC_close(s);
return(-1);
}
if (((ifreq.ifr_flags & IFF_UP) &&
@@ -107,6 +107,6 @@ again:
loopback = 1;
goto again;
}
- (void)_close(s);
+ (void)_RPC_close(s);
return (gotit ? 0 : -1);
}
diff --git a/c/src/librpc/src/rpc/pmap_clnt.c b/c/src/librpc/src/rpc/pmap_clnt.c
index 955748ba10..469e65b233 100644
--- a/c/src/librpc/src/rpc/pmap_clnt.c
+++ b/c/src/librpc/src/rpc/pmap_clnt.c
@@ -102,7 +102,7 @@ pmap_set(program, version, protocol, port)
}
CLNT_DESTROY(client);
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
return (rslt);
}
@@ -144,6 +144,6 @@ pmap_unset(program, version)
tottimeout);
CLNT_DESTROY(client);
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
return (rslt);
}
diff --git a/c/src/librpc/src/rpc/pmap_getmaps.c b/c/src/librpc/src/rpc/pmap_getmaps.c
index 138e07c798..3a5f6aa16e 100644
--- a/c/src/librpc/src/rpc/pmap_getmaps.c
+++ b/c/src/librpc/src/rpc/pmap_getmaps.c
@@ -80,7 +80,7 @@ pmap_getmaps(address)
CLNT_DESTROY(client);
}
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
address->sin_port = 0;
return (head);
}
diff --git a/c/src/librpc/src/rpc/pmap_getport.c b/c/src/librpc/src/rpc/pmap_getport.c
index 13b6a8bbcc..4029f1e5b9 100644
--- a/c/src/librpc/src/rpc/pmap_getport.c
+++ b/c/src/librpc/src/rpc/pmap_getport.c
@@ -85,7 +85,7 @@ pmap_getport(address, program, version, protocol)
CLNT_DESTROY(client);
}
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
address->sin_port = 0;
return (port);
}
diff --git a/c/src/librpc/src/rpc/pmap_rmt.c b/c/src/librpc/src/rpc/pmap_rmt.c
index 822293a00c..cb04941415 100644
--- a/c/src/librpc/src/rpc/pmap_rmt.c
+++ b/c/src/librpc/src/rpc/pmap_rmt.c
@@ -98,7 +98,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
stat = RPC_FAILED;
}
if (socket != -1)
- (void)_close(socket);
+ (void)_RPC_close(socket);
addr->sin_port = 0;
return (stat);
}
@@ -408,7 +408,7 @@ done_broad:
if (fds != &readfds)
free(fds);
if (sock >= 0)
- (void)_close(sock);
+ (void)_RPC_close(sock);
AUTH_DESTROY(unix_auth);
return (stat);
}
diff --git a/c/src/librpc/src/rpc/rtime.c b/c/src/librpc/src/rpc/rtime.c
index b37d6bdb52..ad83dee2dc 100644
--- a/c/src/librpc/src/rpc/rtime.c
+++ b/c/src/librpc/src/rpc/rtime.c
@@ -129,7 +129,7 @@ rtime(addrp, timep, timeout)
do_close(s);
return(-1);
}
- res = _read(s, (char *)&thetime, sizeof(thetime));
+ res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
do_close(s);
if (res < 0) {
return(-1);
@@ -152,6 +152,6 @@ do_close(s)
int save;
save = errno;
- (void)_close(s);
+ (void)_RPC_close(s);
errno = save;
}
diff --git a/c/src/librpc/src/rpc/svc_tcp.c b/c/src/librpc/src/rpc/svc_tcp.c
index 81ae27bead..0c2133a049 100644
--- a/c/src/librpc/src/rpc/svc_tcp.c
+++ b/c/src/librpc/src/rpc/svc_tcp.c
@@ -145,7 +145,7 @@ svctcp_create(sock, sendsize, recvsize)
if (ioctl(sock, FIONBIO, &on) < 0) {
perror("svc_tcp.c - cannot turn on non-blocking mode");
if (madesock)
- (void)_close(sock);
+ (void)_RPC_close(sock);
return ((SVCXPRT *)NULL);
}
memset(&addr, 0, sizeof (addr));
@@ -159,7 +159,7 @@ svctcp_create(sock, sendsize, recvsize)
(listen(sock, 2) != 0)) {
perror("svctcp_.c - cannot getsockname or listen");
if (madesock)
- (void)_close(sock);
+ (void)_RPC_close(sock);
return ((SVCXPRT *)NULL);
}
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
@@ -257,7 +257,7 @@ rendezvous_request(xprt)
* Guard against FTP bounce attacks.
*/
if (addr.sin_port == htons(20)) {
- _close(sock);
+ _RPC_close(sock);
return (FALSE);
}
/*
@@ -265,7 +265,7 @@ rendezvous_request(xprt)
*/
off = 0;
if (ioctl(sock, FIONBIO, &off) < 0) {
- _close(sock);
+ _RPC_close(sock);
return (FALSE);
}
/*
@@ -291,7 +291,7 @@ svctcp_destroy(xprt)
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
xprt_unregister(xprt);
- (void)_close(xprt->xp_sock);
+ (void)_RPC_close(xprt->xp_sock);
if (xprt->xp_port != 0) {
/* a rendezvouser socket */
xprt->xp_port = 0;
@@ -373,7 +373,7 @@ readtcp(xprt, buf, len)
}
}
} while (!FD_ISSET(sock, fds));
- if ((len = _read(sock, buf, len)) > 0) {
+ if ((len = _RPC_read(sock, buf, len)) > 0) {
if (fds != NULL)
free(fds);
return (len);
@@ -398,7 +398,7 @@ writetcp(xprt, buf, len)
register int i, cnt;
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
- if ((i = _write(xprt->xp_sock, buf, cnt)) < 0) {
+ if ((i = _RPC_write(xprt->xp_sock, buf, cnt)) < 0) {
((struct tcp_conn *)(xprt->xp_p1))->strm_stat =
XPRT_DIED;
return (-1);
diff --git a/c/src/librpc/src/rpc/svc_udp.c b/c/src/librpc/src/rpc/svc_udp.c
index e5d90a184f..652683b3da 100644
--- a/c/src/librpc/src/rpc/svc_udp.c
+++ b/c/src/librpc/src/rpc/svc_udp.c
@@ -123,7 +123,7 @@ svcudp_bufcreate(sock, sendsz, recvsz)
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
perror("svcudp_create - cannot getsockname");
if (madesock)
- (void)_close(sock);
+ (void)_RPC_close(sock);
return ((SVCXPRT *)NULL);
}
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
@@ -259,7 +259,7 @@ svcudp_destroy(xprt)
register struct svcudp_data *su = su_data(xprt);
xprt_unregister(xprt);
- (void)_close(xprt->xp_sock);
+ (void)_RPC_close(xprt->xp_sock);
XDR_DESTROY(&(su->su_xdrs));
mem_free(rpc_buffer(xprt), su->su_iosz);
mem_free((caddr_t)su, sizeof(struct svcudp_data));
diff --git a/c/src/librpc/src/rpc/svc_unix.c b/c/src/librpc/src/rpc/svc_unix.c
index b0f3175c0e..53772ecd4a 100644
--- a/c/src/librpc/src/rpc/svc_unix.c
+++ b/c/src/librpc/src/rpc/svc_unix.c
@@ -213,7 +213,7 @@ svcunix_create(sock, sendsize, recvsize, path)
(listen(sock, 2) != 0)) {
perror("svc_unix.c - cannot getsockname or listen");
if (madesock)
- (void)_close(sock);
+ (void)_RPC_close(sock);
return ((SVCXPRT *)NULL);
}
r = (struct unix_rendezvous *)mem_alloc(sizeof(*r));
@@ -333,7 +333,7 @@ svcunix_destroy(xprt)
register struct unix_conn *cd = (struct unix_conn *)xprt->xp_p1;
xprt_unregister(xprt);
- (void)_close(xprt->xp_sock);
+ (void)_RPC_close(xprt->xp_sock);
if (xprt->xp_port != 0) {
/* a rendezvouser socket */
xprt->xp_port = 0;