forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -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>
|
2000-10-25 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
|
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/$(LIBNAME)$(LIB_VARIANT).a
|
|||||||
# Add local stuff here using +=
|
# 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)
|
$(LIB): $(OBJS)
|
||||||
$(make-library)
|
$(make-library)
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
|||||||
msg("alarm caught it, must be unreachable.");
|
msg("alarm caught it, must be unreachable.");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
res = _read(s, (char *)&thetime, sizeof(thetime));
|
res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
|
||||||
if (res != sizeof(thetime)) {
|
if (res != sizeof(thetime)) {
|
||||||
if (saw_alarm)
|
if (saw_alarm)
|
||||||
msg("timed out TCP call.");
|
msg("timed out TCP call.");
|
||||||
@@ -449,7 +449,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
|||||||
time_valid = 1;
|
time_valid = 1;
|
||||||
}
|
}
|
||||||
save = errno;
|
save = errno;
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
errno = save;
|
errno = save;
|
||||||
s = RPC_ANYSOCK;
|
s = RPC_ANYSOCK;
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ error:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (s != RPC_ANYSOCK)
|
if (s != RPC_ANYSOCK)
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
|
|
||||||
if (clnt != NULL)
|
if (clnt != NULL)
|
||||||
clnt_destroy(clnt);
|
clnt_destroy(clnt);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
|
|||||||
} else {
|
} else {
|
||||||
crp->valid = 0;
|
crp->valid = 0;
|
||||||
if (crp->socket != -1)
|
if (crp->socket != -1)
|
||||||
(void)_close(crp->socket);
|
(void)_RPC_close(crp->socket);
|
||||||
crp->socket = RPC_ANYSOCK;
|
crp->socket = RPC_ANYSOCK;
|
||||||
if (crp->client) {
|
if (crp->client) {
|
||||||
clnt_destroy(crp->client);
|
clnt_destroy(crp->client);
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
||||||
rpc_createerr.cf_error.re_errno = errno;
|
rpc_createerr.cf_error.re_errno = errno;
|
||||||
if (*sockp != -1)
|
if (*sockp != -1)
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
ct->ct_closeit = TRUE;
|
ct->ct_closeit = TRUE;
|
||||||
@@ -200,7 +200,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
XDR_ENCODE);
|
XDR_ENCODE);
|
||||||
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
}
|
}
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
@@ -474,7 +474,7 @@ clnttcp_destroy(h)
|
|||||||
(struct ct_data *) h->cl_private;
|
(struct ct_data *) h->cl_private;
|
||||||
|
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(ct->ct_sock);
|
(void)_RPC_close(ct->ct_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(ct->ct_xdrs));
|
XDR_DESTROY(&(ct->ct_xdrs));
|
||||||
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
||||||
@@ -544,7 +544,7 @@ readtcp(ct, buf, len)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (len = _read(ct->ct_sock, buf, len)) {
|
switch (len = _RPC_read(ct->ct_sock, buf, len)) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
/* premature eof */
|
/* premature eof */
|
||||||
@@ -570,7 +570,7 @@ writetcp(ct, buf, len)
|
|||||||
register int i, cnt;
|
register int i, cnt;
|
||||||
|
|
||||||
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
|
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_errno = errno;
|
||||||
ct->ct_error.re_status = RPC_CANTSEND;
|
ct->ct_error.re_status = RPC_CANTSEND;
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ clntudp_destroy(cl)
|
|||||||
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
||||||
|
|
||||||
if (cu->cu_closeit) {
|
if (cu->cu_closeit) {
|
||||||
(void)_close(cu->cu_sock);
|
(void)_RPC_close(cu->cu_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(cu->cu_outxdrs));
|
XDR_DESTROY(&(cu->cu_outxdrs));
|
||||||
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
|
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
||||||
rpc_createerr.cf_error.re_errno = errno;
|
rpc_createerr.cf_error.re_errno = errno;
|
||||||
if (*sockp != -1)
|
if (*sockp != -1)
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
ct->ct_closeit = TRUE;
|
ct->ct_closeit = TRUE;
|
||||||
@@ -191,7 +191,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
XDR_ENCODE);
|
XDR_ENCODE);
|
||||||
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
}
|
}
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
@@ -465,7 +465,7 @@ clntunix_destroy(h)
|
|||||||
(struct ct_data *) h->cl_private;
|
(struct ct_data *) h->cl_private;
|
||||||
|
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(ct->ct_sock);
|
(void)_RPC_close(ct->ct_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(ct->ct_xdrs));
|
XDR_DESTROY(&(ct->ct_xdrs));
|
||||||
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ get_myaddress(addr)
|
|||||||
ifc.ifc_len = sizeof (buf);
|
ifc.ifc_len = sizeof (buf);
|
||||||
ifc.ifc_buf = buf;
|
ifc.ifc_buf = buf;
|
||||||
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
|
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
|
||||||
_close(s);
|
_RPC_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
again:
|
again:
|
||||||
@@ -83,7 +83,7 @@ again:
|
|||||||
while (ifr < end) {
|
while (ifr < end) {
|
||||||
ifreq = *ifr;
|
ifreq = *ifr;
|
||||||
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
|
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
|
||||||
_close(s);
|
_RPC_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
if (((ifreq.ifr_flags & IFF_UP) &&
|
if (((ifreq.ifr_flags & IFF_UP) &&
|
||||||
@@ -107,6 +107,6 @@ again:
|
|||||||
loopback = 1;
|
loopback = 1;
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
return (gotit ? 0 : -1);
|
return (gotit ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ pmap_set(program, version, protocol, port)
|
|||||||
}
|
}
|
||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
return (rslt);
|
return (rslt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,6 +144,6 @@ pmap_unset(program, version)
|
|||||||
tottimeout);
|
tottimeout);
|
||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
return (rslt);
|
return (rslt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ pmap_getmaps(address)
|
|||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
address->sin_port = 0;
|
address->sin_port = 0;
|
||||||
return (head);
|
return (head);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ pmap_getport(address, program, version, protocol)
|
|||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
address->sin_port = 0;
|
address->sin_port = 0;
|
||||||
return (port);
|
return (port);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
|
|||||||
stat = RPC_FAILED;
|
stat = RPC_FAILED;
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
addr->sin_port = 0;
|
addr->sin_port = 0;
|
||||||
return (stat);
|
return (stat);
|
||||||
}
|
}
|
||||||
@@ -408,7 +408,7 @@ done_broad:
|
|||||||
if (fds != &readfds)
|
if (fds != &readfds)
|
||||||
free(fds);
|
free(fds);
|
||||||
if (sock >= 0)
|
if (sock >= 0)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
AUTH_DESTROY(unix_auth);
|
AUTH_DESTROY(unix_auth);
|
||||||
return (stat);
|
return (stat);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ rtime(addrp, timep, timeout)
|
|||||||
do_close(s);
|
do_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
res = _read(s, (char *)&thetime, sizeof(thetime));
|
res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
|
||||||
do_close(s);
|
do_close(s);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
return(-1);
|
return(-1);
|
||||||
@@ -152,6 +152,6 @@ do_close(s)
|
|||||||
int save;
|
int save;
|
||||||
|
|
||||||
save = errno;
|
save = errno;
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
errno = save;
|
errno = save;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ svctcp_create(sock, sendsize, recvsize)
|
|||||||
if (ioctl(sock, FIONBIO, &on) < 0) {
|
if (ioctl(sock, FIONBIO, &on) < 0) {
|
||||||
perror("svc_tcp.c - cannot turn on non-blocking mode");
|
perror("svc_tcp.c - cannot turn on non-blocking mode");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
memset(&addr, 0, sizeof (addr));
|
memset(&addr, 0, sizeof (addr));
|
||||||
@@ -159,7 +159,7 @@ svctcp_create(sock, sendsize, recvsize)
|
|||||||
(listen(sock, 2) != 0)) {
|
(listen(sock, 2) != 0)) {
|
||||||
perror("svctcp_.c - cannot getsockname or listen");
|
perror("svctcp_.c - cannot getsockname or listen");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
|
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
|
||||||
@@ -257,7 +257,7 @@ rendezvous_request(xprt)
|
|||||||
* Guard against FTP bounce attacks.
|
* Guard against FTP bounce attacks.
|
||||||
*/
|
*/
|
||||||
if (addr.sin_port == htons(20)) {
|
if (addr.sin_port == htons(20)) {
|
||||||
_close(sock);
|
_RPC_close(sock);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -265,7 +265,7 @@ rendezvous_request(xprt)
|
|||||||
*/
|
*/
|
||||||
off = 0;
|
off = 0;
|
||||||
if (ioctl(sock, FIONBIO, &off) < 0) {
|
if (ioctl(sock, FIONBIO, &off) < 0) {
|
||||||
_close(sock);
|
_RPC_close(sock);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -291,7 +291,7 @@ svctcp_destroy(xprt)
|
|||||||
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
|
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
if (xprt->xp_port != 0) {
|
if (xprt->xp_port != 0) {
|
||||||
/* a rendezvouser socket */
|
/* a rendezvouser socket */
|
||||||
xprt->xp_port = 0;
|
xprt->xp_port = 0;
|
||||||
@@ -373,7 +373,7 @@ readtcp(xprt, buf, len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!FD_ISSET(sock, fds));
|
} while (!FD_ISSET(sock, fds));
|
||||||
if ((len = _read(sock, buf, len)) > 0) {
|
if ((len = _RPC_read(sock, buf, len)) > 0) {
|
||||||
if (fds != NULL)
|
if (fds != NULL)
|
||||||
free(fds);
|
free(fds);
|
||||||
return (len);
|
return (len);
|
||||||
@@ -398,7 +398,7 @@ writetcp(xprt, buf, len)
|
|||||||
register int i, cnt;
|
register int i, cnt;
|
||||||
|
|
||||||
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
|
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 =
|
((struct tcp_conn *)(xprt->xp_p1))->strm_stat =
|
||||||
XPRT_DIED;
|
XPRT_DIED;
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ svcudp_bufcreate(sock, sendsz, recvsz)
|
|||||||
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
|
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
|
||||||
perror("svcudp_create - cannot getsockname");
|
perror("svcudp_create - cannot getsockname");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
|
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
|
||||||
@@ -259,7 +259,7 @@ svcudp_destroy(xprt)
|
|||||||
register struct svcudp_data *su = su_data(xprt);
|
register struct svcudp_data *su = su_data(xprt);
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
XDR_DESTROY(&(su->su_xdrs));
|
XDR_DESTROY(&(su->su_xdrs));
|
||||||
mem_free(rpc_buffer(xprt), su->su_iosz);
|
mem_free(rpc_buffer(xprt), su->su_iosz);
|
||||||
mem_free((caddr_t)su, sizeof(struct svcudp_data));
|
mem_free((caddr_t)su, sizeof(struct svcudp_data));
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ svcunix_create(sock, sendsize, recvsize, path)
|
|||||||
(listen(sock, 2) != 0)) {
|
(listen(sock, 2) != 0)) {
|
||||||
perror("svc_unix.c - cannot getsockname or listen");
|
perror("svc_unix.c - cannot getsockname or listen");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
r = (struct unix_rendezvous *)mem_alloc(sizeof(*r));
|
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;
|
register struct unix_conn *cd = (struct unix_conn *)xprt->xp_p1;
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
if (xprt->xp_port != 0) {
|
if (xprt->xp_port != 0) {
|
||||||
/* a rendezvouser socket */
|
/* a rendezvouser socket */
|
||||||
xprt->xp_port = 0;
|
xprt->xp_port = 0;
|
||||||
|
|||||||
@@ -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>
|
2000-10-25 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
|
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/$(LIBNAME)$(LIB_VARIANT).a
|
|||||||
# Add local stuff here using +=
|
# 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)
|
$(LIB): $(OBJS)
|
||||||
$(make-library)
|
$(make-library)
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
|||||||
msg("alarm caught it, must be unreachable.");
|
msg("alarm caught it, must be unreachable.");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
res = _read(s, (char *)&thetime, sizeof(thetime));
|
res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
|
||||||
if (res != sizeof(thetime)) {
|
if (res != sizeof(thetime)) {
|
||||||
if (saw_alarm)
|
if (saw_alarm)
|
||||||
msg("timed out TCP call.");
|
msg("timed out TCP call.");
|
||||||
@@ -449,7 +449,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
|||||||
time_valid = 1;
|
time_valid = 1;
|
||||||
}
|
}
|
||||||
save = errno;
|
save = errno;
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
errno = save;
|
errno = save;
|
||||||
s = RPC_ANYSOCK;
|
s = RPC_ANYSOCK;
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ error:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (s != RPC_ANYSOCK)
|
if (s != RPC_ANYSOCK)
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
|
|
||||||
if (clnt != NULL)
|
if (clnt != NULL)
|
||||||
clnt_destroy(clnt);
|
clnt_destroy(clnt);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
|
|||||||
} else {
|
} else {
|
||||||
crp->valid = 0;
|
crp->valid = 0;
|
||||||
if (crp->socket != -1)
|
if (crp->socket != -1)
|
||||||
(void)_close(crp->socket);
|
(void)_RPC_close(crp->socket);
|
||||||
crp->socket = RPC_ANYSOCK;
|
crp->socket = RPC_ANYSOCK;
|
||||||
if (crp->client) {
|
if (crp->client) {
|
||||||
clnt_destroy(crp->client);
|
clnt_destroy(crp->client);
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
||||||
rpc_createerr.cf_error.re_errno = errno;
|
rpc_createerr.cf_error.re_errno = errno;
|
||||||
if (*sockp != -1)
|
if (*sockp != -1)
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
ct->ct_closeit = TRUE;
|
ct->ct_closeit = TRUE;
|
||||||
@@ -200,7 +200,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
XDR_ENCODE);
|
XDR_ENCODE);
|
||||||
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
}
|
}
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
@@ -474,7 +474,7 @@ clnttcp_destroy(h)
|
|||||||
(struct ct_data *) h->cl_private;
|
(struct ct_data *) h->cl_private;
|
||||||
|
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(ct->ct_sock);
|
(void)_RPC_close(ct->ct_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(ct->ct_xdrs));
|
XDR_DESTROY(&(ct->ct_xdrs));
|
||||||
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
||||||
@@ -544,7 +544,7 @@ readtcp(ct, buf, len)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (len = _read(ct->ct_sock, buf, len)) {
|
switch (len = _RPC_read(ct->ct_sock, buf, len)) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
/* premature eof */
|
/* premature eof */
|
||||||
@@ -570,7 +570,7 @@ writetcp(ct, buf, len)
|
|||||||
register int i, cnt;
|
register int i, cnt;
|
||||||
|
|
||||||
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
|
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_errno = errno;
|
||||||
ct->ct_error.re_status = RPC_CANTSEND;
|
ct->ct_error.re_status = RPC_CANTSEND;
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ clntudp_destroy(cl)
|
|||||||
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
||||||
|
|
||||||
if (cu->cu_closeit) {
|
if (cu->cu_closeit) {
|
||||||
(void)_close(cu->cu_sock);
|
(void)_RPC_close(cu->cu_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(cu->cu_outxdrs));
|
XDR_DESTROY(&(cu->cu_outxdrs));
|
||||||
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
|
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
||||||
rpc_createerr.cf_error.re_errno = errno;
|
rpc_createerr.cf_error.re_errno = errno;
|
||||||
if (*sockp != -1)
|
if (*sockp != -1)
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
ct->ct_closeit = TRUE;
|
ct->ct_closeit = TRUE;
|
||||||
@@ -191,7 +191,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
XDR_ENCODE);
|
XDR_ENCODE);
|
||||||
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
}
|
}
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
@@ -465,7 +465,7 @@ clntunix_destroy(h)
|
|||||||
(struct ct_data *) h->cl_private;
|
(struct ct_data *) h->cl_private;
|
||||||
|
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(ct->ct_sock);
|
(void)_RPC_close(ct->ct_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(ct->ct_xdrs));
|
XDR_DESTROY(&(ct->ct_xdrs));
|
||||||
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ get_myaddress(addr)
|
|||||||
ifc.ifc_len = sizeof (buf);
|
ifc.ifc_len = sizeof (buf);
|
||||||
ifc.ifc_buf = buf;
|
ifc.ifc_buf = buf;
|
||||||
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
|
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
|
||||||
_close(s);
|
_RPC_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
again:
|
again:
|
||||||
@@ -83,7 +83,7 @@ again:
|
|||||||
while (ifr < end) {
|
while (ifr < end) {
|
||||||
ifreq = *ifr;
|
ifreq = *ifr;
|
||||||
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
|
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
|
||||||
_close(s);
|
_RPC_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
if (((ifreq.ifr_flags & IFF_UP) &&
|
if (((ifreq.ifr_flags & IFF_UP) &&
|
||||||
@@ -107,6 +107,6 @@ again:
|
|||||||
loopback = 1;
|
loopback = 1;
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
return (gotit ? 0 : -1);
|
return (gotit ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ pmap_set(program, version, protocol, port)
|
|||||||
}
|
}
|
||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
return (rslt);
|
return (rslt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,6 +144,6 @@ pmap_unset(program, version)
|
|||||||
tottimeout);
|
tottimeout);
|
||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
return (rslt);
|
return (rslt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ pmap_getmaps(address)
|
|||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
address->sin_port = 0;
|
address->sin_port = 0;
|
||||||
return (head);
|
return (head);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ pmap_getport(address, program, version, protocol)
|
|||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
address->sin_port = 0;
|
address->sin_port = 0;
|
||||||
return (port);
|
return (port);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
|
|||||||
stat = RPC_FAILED;
|
stat = RPC_FAILED;
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
addr->sin_port = 0;
|
addr->sin_port = 0;
|
||||||
return (stat);
|
return (stat);
|
||||||
}
|
}
|
||||||
@@ -408,7 +408,7 @@ done_broad:
|
|||||||
if (fds != &readfds)
|
if (fds != &readfds)
|
||||||
free(fds);
|
free(fds);
|
||||||
if (sock >= 0)
|
if (sock >= 0)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
AUTH_DESTROY(unix_auth);
|
AUTH_DESTROY(unix_auth);
|
||||||
return (stat);
|
return (stat);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ rtime(addrp, timep, timeout)
|
|||||||
do_close(s);
|
do_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
res = _read(s, (char *)&thetime, sizeof(thetime));
|
res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
|
||||||
do_close(s);
|
do_close(s);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
return(-1);
|
return(-1);
|
||||||
@@ -152,6 +152,6 @@ do_close(s)
|
|||||||
int save;
|
int save;
|
||||||
|
|
||||||
save = errno;
|
save = errno;
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
errno = save;
|
errno = save;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ svctcp_create(sock, sendsize, recvsize)
|
|||||||
if (ioctl(sock, FIONBIO, &on) < 0) {
|
if (ioctl(sock, FIONBIO, &on) < 0) {
|
||||||
perror("svc_tcp.c - cannot turn on non-blocking mode");
|
perror("svc_tcp.c - cannot turn on non-blocking mode");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
memset(&addr, 0, sizeof (addr));
|
memset(&addr, 0, sizeof (addr));
|
||||||
@@ -159,7 +159,7 @@ svctcp_create(sock, sendsize, recvsize)
|
|||||||
(listen(sock, 2) != 0)) {
|
(listen(sock, 2) != 0)) {
|
||||||
perror("svctcp_.c - cannot getsockname or listen");
|
perror("svctcp_.c - cannot getsockname or listen");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
|
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
|
||||||
@@ -257,7 +257,7 @@ rendezvous_request(xprt)
|
|||||||
* Guard against FTP bounce attacks.
|
* Guard against FTP bounce attacks.
|
||||||
*/
|
*/
|
||||||
if (addr.sin_port == htons(20)) {
|
if (addr.sin_port == htons(20)) {
|
||||||
_close(sock);
|
_RPC_close(sock);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -265,7 +265,7 @@ rendezvous_request(xprt)
|
|||||||
*/
|
*/
|
||||||
off = 0;
|
off = 0;
|
||||||
if (ioctl(sock, FIONBIO, &off) < 0) {
|
if (ioctl(sock, FIONBIO, &off) < 0) {
|
||||||
_close(sock);
|
_RPC_close(sock);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -291,7 +291,7 @@ svctcp_destroy(xprt)
|
|||||||
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
|
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
if (xprt->xp_port != 0) {
|
if (xprt->xp_port != 0) {
|
||||||
/* a rendezvouser socket */
|
/* a rendezvouser socket */
|
||||||
xprt->xp_port = 0;
|
xprt->xp_port = 0;
|
||||||
@@ -373,7 +373,7 @@ readtcp(xprt, buf, len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!FD_ISSET(sock, fds));
|
} while (!FD_ISSET(sock, fds));
|
||||||
if ((len = _read(sock, buf, len)) > 0) {
|
if ((len = _RPC_read(sock, buf, len)) > 0) {
|
||||||
if (fds != NULL)
|
if (fds != NULL)
|
||||||
free(fds);
|
free(fds);
|
||||||
return (len);
|
return (len);
|
||||||
@@ -398,7 +398,7 @@ writetcp(xprt, buf, len)
|
|||||||
register int i, cnt;
|
register int i, cnt;
|
||||||
|
|
||||||
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
|
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 =
|
((struct tcp_conn *)(xprt->xp_p1))->strm_stat =
|
||||||
XPRT_DIED;
|
XPRT_DIED;
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ svcudp_bufcreate(sock, sendsz, recvsz)
|
|||||||
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
|
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
|
||||||
perror("svcudp_create - cannot getsockname");
|
perror("svcudp_create - cannot getsockname");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
|
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
|
||||||
@@ -259,7 +259,7 @@ svcudp_destroy(xprt)
|
|||||||
register struct svcudp_data *su = su_data(xprt);
|
register struct svcudp_data *su = su_data(xprt);
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
XDR_DESTROY(&(su->su_xdrs));
|
XDR_DESTROY(&(su->su_xdrs));
|
||||||
mem_free(rpc_buffer(xprt), su->su_iosz);
|
mem_free(rpc_buffer(xprt), su->su_iosz);
|
||||||
mem_free((caddr_t)su, sizeof(struct svcudp_data));
|
mem_free((caddr_t)su, sizeof(struct svcudp_data));
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ svcunix_create(sock, sendsize, recvsize, path)
|
|||||||
(listen(sock, 2) != 0)) {
|
(listen(sock, 2) != 0)) {
|
||||||
perror("svc_unix.c - cannot getsockname or listen");
|
perror("svc_unix.c - cannot getsockname or listen");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
r = (struct unix_rendezvous *)mem_alloc(sizeof(*r));
|
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;
|
register struct unix_conn *cd = (struct unix_conn *)xprt->xp_p1;
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
if (xprt->xp_port != 0) {
|
if (xprt->xp_port != 0) {
|
||||||
/* a rendezvouser socket */
|
/* a rendezvouser socket */
|
||||||
xprt->xp_port = 0;
|
xprt->xp_port = 0;
|
||||||
|
|||||||
@@ -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>
|
2000-10-25 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
|
||||||
|
|
||||||
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
|
* Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros.
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ TMPINSTALL_FILES += $(PROJECT_RELEASE)/lib/$(LIBNAME)$(LIB_VARIANT).a
|
|||||||
# Add local stuff here using +=
|
# 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)
|
$(LIB): $(OBJS)
|
||||||
$(make-library)
|
$(make-library)
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
|||||||
msg("alarm caught it, must be unreachable.");
|
msg("alarm caught it, must be unreachable.");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
res = _read(s, (char *)&thetime, sizeof(thetime));
|
res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
|
||||||
if (res != sizeof(thetime)) {
|
if (res != sizeof(thetime)) {
|
||||||
if (saw_alarm)
|
if (saw_alarm)
|
||||||
msg("timed out TCP call.");
|
msg("timed out TCP call.");
|
||||||
@@ -449,7 +449,7 @@ __rpc_get_time_offset(td, srv, thost, uaddr, netid)
|
|||||||
time_valid = 1;
|
time_valid = 1;
|
||||||
}
|
}
|
||||||
save = errno;
|
save = errno;
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
errno = save;
|
errno = save;
|
||||||
s = RPC_ANYSOCK;
|
s = RPC_ANYSOCK;
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ error:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (s != RPC_ANYSOCK)
|
if (s != RPC_ANYSOCK)
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
|
|
||||||
if (clnt != NULL)
|
if (clnt != NULL)
|
||||||
clnt_destroy(clnt);
|
clnt_destroy(clnt);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
|
|||||||
} else {
|
} else {
|
||||||
crp->valid = 0;
|
crp->valid = 0;
|
||||||
if (crp->socket != -1)
|
if (crp->socket != -1)
|
||||||
(void)_close(crp->socket);
|
(void)_RPC_close(crp->socket);
|
||||||
crp->socket = RPC_ANYSOCK;
|
crp->socket = RPC_ANYSOCK;
|
||||||
if (crp->client) {
|
if (crp->client) {
|
||||||
clnt_destroy(crp->client);
|
clnt_destroy(crp->client);
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
||||||
rpc_createerr.cf_error.re_errno = errno;
|
rpc_createerr.cf_error.re_errno = errno;
|
||||||
if (*sockp != -1)
|
if (*sockp != -1)
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
ct->ct_closeit = TRUE;
|
ct->ct_closeit = TRUE;
|
||||||
@@ -200,7 +200,7 @@ clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
XDR_ENCODE);
|
XDR_ENCODE);
|
||||||
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
}
|
}
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
@@ -474,7 +474,7 @@ clnttcp_destroy(h)
|
|||||||
(struct ct_data *) h->cl_private;
|
(struct ct_data *) h->cl_private;
|
||||||
|
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(ct->ct_sock);
|
(void)_RPC_close(ct->ct_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(ct->ct_xdrs));
|
XDR_DESTROY(&(ct->ct_xdrs));
|
||||||
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
||||||
@@ -544,7 +544,7 @@ readtcp(ct, buf, len)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (len = _read(ct->ct_sock, buf, len)) {
|
switch (len = _RPC_read(ct->ct_sock, buf, len)) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
/* premature eof */
|
/* premature eof */
|
||||||
@@ -570,7 +570,7 @@ writetcp(ct, buf, len)
|
|||||||
register int i, cnt;
|
register int i, cnt;
|
||||||
|
|
||||||
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
|
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_errno = errno;
|
||||||
ct->ct_error.re_status = RPC_CANTSEND;
|
ct->ct_error.re_status = RPC_CANTSEND;
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|||||||
@@ -559,7 +559,7 @@ clntudp_destroy(cl)
|
|||||||
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
register struct cu_data *cu = (struct cu_data *)cl->cl_private;
|
||||||
|
|
||||||
if (cu->cu_closeit) {
|
if (cu->cu_closeit) {
|
||||||
(void)_close(cu->cu_sock);
|
(void)_RPC_close(cu->cu_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(cu->cu_outxdrs));
|
XDR_DESTROY(&(cu->cu_outxdrs));
|
||||||
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
|
mem_free((caddr_t)cu, (sizeof(*cu) + cu->cu_sendsz + cu->cu_recvsz));
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
|
||||||
rpc_createerr.cf_error.re_errno = errno;
|
rpc_createerr.cf_error.re_errno = errno;
|
||||||
if (*sockp != -1)
|
if (*sockp != -1)
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
ct->ct_closeit = TRUE;
|
ct->ct_closeit = TRUE;
|
||||||
@@ -191,7 +191,7 @@ clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
|
|||||||
XDR_ENCODE);
|
XDR_ENCODE);
|
||||||
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
if (! xdr_callhdr(&(ct->ct_xdrs), &call_msg)) {
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(*sockp);
|
(void)_RPC_close(*sockp);
|
||||||
}
|
}
|
||||||
goto fooy;
|
goto fooy;
|
||||||
}
|
}
|
||||||
@@ -465,7 +465,7 @@ clntunix_destroy(h)
|
|||||||
(struct ct_data *) h->cl_private;
|
(struct ct_data *) h->cl_private;
|
||||||
|
|
||||||
if (ct->ct_closeit) {
|
if (ct->ct_closeit) {
|
||||||
(void)_close(ct->ct_sock);
|
(void)_RPC_close(ct->ct_sock);
|
||||||
}
|
}
|
||||||
XDR_DESTROY(&(ct->ct_xdrs));
|
XDR_DESTROY(&(ct->ct_xdrs));
|
||||||
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
mem_free((caddr_t)ct, sizeof(struct ct_data));
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ get_myaddress(addr)
|
|||||||
ifc.ifc_len = sizeof (buf);
|
ifc.ifc_len = sizeof (buf);
|
||||||
ifc.ifc_buf = buf;
|
ifc.ifc_buf = buf;
|
||||||
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
|
if (ioctl(s, SIOCGIFCONF, (char *)&ifc) < 0) {
|
||||||
_close(s);
|
_RPC_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
again:
|
again:
|
||||||
@@ -83,7 +83,7 @@ again:
|
|||||||
while (ifr < end) {
|
while (ifr < end) {
|
||||||
ifreq = *ifr;
|
ifreq = *ifr;
|
||||||
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
|
if (ioctl(s, SIOCGIFFLAGS, (char *)&ifreq) < 0) {
|
||||||
_close(s);
|
_RPC_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
if (((ifreq.ifr_flags & IFF_UP) &&
|
if (((ifreq.ifr_flags & IFF_UP) &&
|
||||||
@@ -107,6 +107,6 @@ again:
|
|||||||
loopback = 1;
|
loopback = 1;
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
return (gotit ? 0 : -1);
|
return (gotit ? 0 : -1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ pmap_set(program, version, protocol, port)
|
|||||||
}
|
}
|
||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
return (rslt);
|
return (rslt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,6 +144,6 @@ pmap_unset(program, version)
|
|||||||
tottimeout);
|
tottimeout);
|
||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
return (rslt);
|
return (rslt);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ pmap_getmaps(address)
|
|||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
address->sin_port = 0;
|
address->sin_port = 0;
|
||||||
return (head);
|
return (head);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ pmap_getport(address, program, version, protocol)
|
|||||||
CLNT_DESTROY(client);
|
CLNT_DESTROY(client);
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
address->sin_port = 0;
|
address->sin_port = 0;
|
||||||
return (port);
|
return (port);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, port_pt
|
|||||||
stat = RPC_FAILED;
|
stat = RPC_FAILED;
|
||||||
}
|
}
|
||||||
if (socket != -1)
|
if (socket != -1)
|
||||||
(void)_close(socket);
|
(void)_RPC_close(socket);
|
||||||
addr->sin_port = 0;
|
addr->sin_port = 0;
|
||||||
return (stat);
|
return (stat);
|
||||||
}
|
}
|
||||||
@@ -408,7 +408,7 @@ done_broad:
|
|||||||
if (fds != &readfds)
|
if (fds != &readfds)
|
||||||
free(fds);
|
free(fds);
|
||||||
if (sock >= 0)
|
if (sock >= 0)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
AUTH_DESTROY(unix_auth);
|
AUTH_DESTROY(unix_auth);
|
||||||
return (stat);
|
return (stat);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ rtime(addrp, timep, timeout)
|
|||||||
do_close(s);
|
do_close(s);
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
res = _read(s, (char *)&thetime, sizeof(thetime));
|
res = _RPC_read(s, (char *)&thetime, sizeof(thetime));
|
||||||
do_close(s);
|
do_close(s);
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
return(-1);
|
return(-1);
|
||||||
@@ -152,6 +152,6 @@ do_close(s)
|
|||||||
int save;
|
int save;
|
||||||
|
|
||||||
save = errno;
|
save = errno;
|
||||||
(void)_close(s);
|
(void)_RPC_close(s);
|
||||||
errno = save;
|
errno = save;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ svctcp_create(sock, sendsize, recvsize)
|
|||||||
if (ioctl(sock, FIONBIO, &on) < 0) {
|
if (ioctl(sock, FIONBIO, &on) < 0) {
|
||||||
perror("svc_tcp.c - cannot turn on non-blocking mode");
|
perror("svc_tcp.c - cannot turn on non-blocking mode");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
memset(&addr, 0, sizeof (addr));
|
memset(&addr, 0, sizeof (addr));
|
||||||
@@ -159,7 +159,7 @@ svctcp_create(sock, sendsize, recvsize)
|
|||||||
(listen(sock, 2) != 0)) {
|
(listen(sock, 2) != 0)) {
|
||||||
perror("svctcp_.c - cannot getsockname or listen");
|
perror("svctcp_.c - cannot getsockname or listen");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
|
r = (struct tcp_rendezvous *)mem_alloc(sizeof(*r));
|
||||||
@@ -257,7 +257,7 @@ rendezvous_request(xprt)
|
|||||||
* Guard against FTP bounce attacks.
|
* Guard against FTP bounce attacks.
|
||||||
*/
|
*/
|
||||||
if (addr.sin_port == htons(20)) {
|
if (addr.sin_port == htons(20)) {
|
||||||
_close(sock);
|
_RPC_close(sock);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -265,7 +265,7 @@ rendezvous_request(xprt)
|
|||||||
*/
|
*/
|
||||||
off = 0;
|
off = 0;
|
||||||
if (ioctl(sock, FIONBIO, &off) < 0) {
|
if (ioctl(sock, FIONBIO, &off) < 0) {
|
||||||
_close(sock);
|
_RPC_close(sock);
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -291,7 +291,7 @@ svctcp_destroy(xprt)
|
|||||||
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
|
register struct tcp_conn *cd = (struct tcp_conn *)xprt->xp_p1;
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
if (xprt->xp_port != 0) {
|
if (xprt->xp_port != 0) {
|
||||||
/* a rendezvouser socket */
|
/* a rendezvouser socket */
|
||||||
xprt->xp_port = 0;
|
xprt->xp_port = 0;
|
||||||
@@ -373,7 +373,7 @@ readtcp(xprt, buf, len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!FD_ISSET(sock, fds));
|
} while (!FD_ISSET(sock, fds));
|
||||||
if ((len = _read(sock, buf, len)) > 0) {
|
if ((len = _RPC_read(sock, buf, len)) > 0) {
|
||||||
if (fds != NULL)
|
if (fds != NULL)
|
||||||
free(fds);
|
free(fds);
|
||||||
return (len);
|
return (len);
|
||||||
@@ -398,7 +398,7 @@ writetcp(xprt, buf, len)
|
|||||||
register int i, cnt;
|
register int i, cnt;
|
||||||
|
|
||||||
for (cnt = len; cnt > 0; cnt -= i, buf += i) {
|
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 =
|
((struct tcp_conn *)(xprt->xp_p1))->strm_stat =
|
||||||
XPRT_DIED;
|
XPRT_DIED;
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ svcudp_bufcreate(sock, sendsz, recvsz)
|
|||||||
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
|
if (getsockname(sock, (struct sockaddr *)&addr, &len) != 0) {
|
||||||
perror("svcudp_create - cannot getsockname");
|
perror("svcudp_create - cannot getsockname");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
|
xprt = (SVCXPRT *)mem_alloc(sizeof(SVCXPRT));
|
||||||
@@ -259,7 +259,7 @@ svcudp_destroy(xprt)
|
|||||||
register struct svcudp_data *su = su_data(xprt);
|
register struct svcudp_data *su = su_data(xprt);
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
XDR_DESTROY(&(su->su_xdrs));
|
XDR_DESTROY(&(su->su_xdrs));
|
||||||
mem_free(rpc_buffer(xprt), su->su_iosz);
|
mem_free(rpc_buffer(xprt), su->su_iosz);
|
||||||
mem_free((caddr_t)su, sizeof(struct svcudp_data));
|
mem_free((caddr_t)su, sizeof(struct svcudp_data));
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ svcunix_create(sock, sendsize, recvsize, path)
|
|||||||
(listen(sock, 2) != 0)) {
|
(listen(sock, 2) != 0)) {
|
||||||
perror("svc_unix.c - cannot getsockname or listen");
|
perror("svc_unix.c - cannot getsockname or listen");
|
||||||
if (madesock)
|
if (madesock)
|
||||||
(void)_close(sock);
|
(void)_RPC_close(sock);
|
||||||
return ((SVCXPRT *)NULL);
|
return ((SVCXPRT *)NULL);
|
||||||
}
|
}
|
||||||
r = (struct unix_rendezvous *)mem_alloc(sizeof(*r));
|
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;
|
register struct unix_conn *cd = (struct unix_conn *)xprt->xp_p1;
|
||||||
|
|
||||||
xprt_unregister(xprt);
|
xprt_unregister(xprt);
|
||||||
(void)_close(xprt->xp_sock);
|
(void)_RPC_close(xprt->xp_sock);
|
||||||
if (xprt->xp_port != 0) {
|
if (xprt->xp_port != 0) {
|
||||||
/* a rendezvouser socket */
|
/* a rendezvouser socket */
|
||||||
xprt->xp_port = 0;
|
xprt->xp_port = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user