diff options
Diffstat (limited to 'lib/libc/yp')
-rw-r--r-- | lib/libc/yp/yplib.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index 5c72573..e1755af 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -32,6 +32,7 @@ static char *rcsid = "$FreeBSD$"; #endif +#include "namespace.h" #include <sys/param.h> #include <sys/types.h> #include <sys/socket.h> @@ -45,6 +46,8 @@ static char *rcsid = "$FreeBSD$"; #include <rpc/rpc.h> #include <rpc/xdr.h> #include <rpcsvc/yp.h> +#include "un-namespace.h" +#include "libc_private.h" /* * We have to define these here due to clashes between yp_prot.h and @@ -337,19 +340,19 @@ _yp_dobind(dom, ypdb) new = 1; } else { /* Check the socket -- may have been hosed by the caller. */ - if (getsockname(ysd->dom_socket, (struct sockaddr *)&check, + if (_getsockname(ysd->dom_socket, (struct sockaddr *)&check, &checklen) == -1 || check.sin_family != AF_INET || check.sin_port != ysd->dom_local_port) { /* Socket became bogus somehow... need to rebind. */ int save, sock; sock = ysd->dom_socket; - save = dup(ysd->dom_socket); + save = _dup(ysd->dom_socket); if (ysd->dom_client != NULL) clnt_destroy(ysd->dom_client); ysd->dom_vers = 0; ysd->dom_client = NULL; - sock = dup2(save, sock); + sock = _dup2(save, sock); _close(save); } } @@ -379,7 +382,7 @@ again: _close(fd); goto skipit; } - if( flock(fd, LOCK_EX|LOCK_NB) == -1 && errno==EWOULDBLOCK) { + if(_flock(fd, LOCK_EX|LOCK_NB) == -1 && errno==EWOULDBLOCK) { struct iovec iov[2]; struct ypbind_resp ybr; u_short ypb_port; @@ -389,7 +392,7 @@ again: iov[1].iov_base = (caddr_t)&ybr; iov[1].iov_len = sizeof ybr; - r = readv(fd, iov, 2); + r = _readv(fd, iov, 2); if(r != iov[0].iov_len + iov[1].iov_len) { _close(fd); ysd->dom_vers = -1; @@ -532,9 +535,9 @@ gotit: */ checklen = sizeof(struct sockaddr_in); bzero((char *)&check, checklen); - bind(ysd->dom_socket, (struct sockaddr *)&check, checklen); + _bind(ysd->dom_socket, (struct sockaddr *)&check, checklen); check.sin_family = AF_INET; - if (!getsockname(ysd->dom_socket, + if (!_getsockname(ysd->dom_socket, (struct sockaddr *)&check, &checklen)) { ysd->dom_local_port = check.sin_port; } else { @@ -564,15 +567,15 @@ _yp_unbind(ypb) if (ypb->dom_client != NULL) { /* Check the socket -- may have been hosed by the caller. */ - if (getsockname(ypb->dom_socket, (struct sockaddr *)&check, + if (_getsockname(ypb->dom_socket, (struct sockaddr *)&check, &checklen) == -1 || check.sin_family != AF_INET || check.sin_port != ypb->dom_local_port) { int save, sock; sock = ypb->dom_socket; - save = dup(ypb->dom_socket); + save = _dup(ypb->dom_socket); clnt_destroy(ypb->dom_client); - sock = dup2(save, sock); + sock = _dup2(save, sock); _close(save); } else clnt_destroy(ypb->dom_client); |