summaryrefslogtreecommitdiffstats
path: root/lib/libc/yp/yplib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/yp/yplib.c')
-rw-r--r--lib/libc/yp/yplib.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c
index 8fc1d56..5c72573 100644
--- a/lib/libc/yp/yplib.c
+++ b/lib/libc/yp/yplib.c
@@ -350,7 +350,7 @@ _yp_dobind(dom, ypdb)
ysd->dom_vers = 0;
ysd->dom_client = NULL;
sock = dup2(save, sock);
- _libc_close(save);
+ _close(save);
}
}
@@ -373,10 +373,10 @@ again:
ysd->dom_socket = -1;
}
snprintf(path, sizeof(path), "%s/%s.%d", BINDINGDIR, dom, 2);
- if((fd = _libc_open(path, O_RDONLY)) == -1) {
+ if((fd = _open(path, O_RDONLY)) == -1) {
/* no binding file, YP is dead. */
/* Try to bring it back to life. */
- _libc_close(fd);
+ _close(fd);
goto skipit;
}
if( flock(fd, LOCK_EX|LOCK_NB) == -1 && errno==EWOULDBLOCK) {
@@ -391,7 +391,7 @@ again:
r = readv(fd, iov, 2);
if(r != iov[0].iov_len + iov[1].iov_len) {
- _libc_close(fd);
+ _close(fd);
ysd->dom_vers = -1;
goto again;
}
@@ -405,12 +405,12 @@ again:
*(u_short *)&ybr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_port;
ysd->dom_server_port = ysd->dom_server_addr.sin_port;
- _libc_close(fd);
+ _close(fd);
goto gotit;
} else {
/* no lock on binding file, YP is dead. */
/* Try to bring it back to life. */
- _libc_close(fd);
+ _close(fd);
goto skipit;
}
}
@@ -478,9 +478,15 @@ skipit:
goto again;
} else {
if (ypbr.ypbind_status != YPBIND_SUCC_VAL) {
+ struct timespec time_to_sleep, time_remaining;
+
clnt_destroy(client);
ysd->dom_vers = -1;
- _libc_sleep(_yplib_timeout/2);
+
+ time_to_sleep.tv_sec = _yplib_timeout/2;
+ time_to_sleep.tv_nsec = 0;
+ _nanosleep(&time_to_sleep,
+ &time_remaining);
goto again;
}
}
@@ -518,7 +524,7 @@ gotit:
ysd->dom_vers = -1;
goto again;
}
- if(_libc_fcntl(ysd->dom_socket, F_SETFD, 1) == -1)
+ if(_fcntl(ysd->dom_socket, F_SETFD, 1) == -1)
perror("fcntl: F_SETFD");
/*
* We want a port number associated with this socket
@@ -567,7 +573,7 @@ _yp_unbind(ypb)
save = dup(ypb->dom_socket);
clnt_destroy(ypb->dom_client);
sock = dup2(save, sock);
- _libc_close(save);
+ _close(save);
} else
clnt_destroy(ypb->dom_client);
}
OpenPOWER on IntegriCloud