s/wait/delta/ to avoid namespace collision.
MFC after: 2 weeks
This commit is contained in:
parent
3f8f97c6e0
commit
0b6cf6e8e4
@ -377,7 +377,7 @@ fetch_ssl(conn_t *conn, int verbose)
|
||||
ssize_t
|
||||
fetch_read(conn_t *conn, char *buf, size_t len)
|
||||
{
|
||||
struct timeval now, timeout, wait;
|
||||
struct timeval now, timeout, delta;
|
||||
fd_set readfds;
|
||||
ssize_t rlen, total;
|
||||
int r;
|
||||
@ -393,19 +393,19 @@ fetch_read(conn_t *conn, char *buf, size_t len)
|
||||
while (fetchTimeout && !FD_ISSET(conn->sd, &readfds)) {
|
||||
FD_SET(conn->sd, &readfds);
|
||||
gettimeofday(&now, NULL);
|
||||
wait.tv_sec = timeout.tv_sec - now.tv_sec;
|
||||
wait.tv_usec = timeout.tv_usec - now.tv_usec;
|
||||
if (wait.tv_usec < 0) {
|
||||
wait.tv_usec += 1000000;
|
||||
wait.tv_sec--;
|
||||
delta.tv_sec = timeout.tv_sec - now.tv_sec;
|
||||
delta.tv_usec = timeout.tv_usec - now.tv_usec;
|
||||
if (delta.tv_usec < 0) {
|
||||
delta.tv_usec += 1000000;
|
||||
delta.tv_sec--;
|
||||
}
|
||||
if (wait.tv_sec < 0) {
|
||||
if (delta.tv_sec < 0) {
|
||||
errno = ETIMEDOUT;
|
||||
fetch_syserr();
|
||||
return (-1);
|
||||
}
|
||||
errno = 0;
|
||||
r = select(conn->sd + 1, &readfds, NULL, NULL, &wait);
|
||||
r = select(conn->sd + 1, &readfds, NULL, NULL, &delta);
|
||||
if (r == -1) {
|
||||
if (errno == EINTR && fetchRestartCalls)
|
||||
continue;
|
||||
@ -503,7 +503,7 @@ fetch_write(conn_t *conn, const char *buf, size_t len)
|
||||
ssize_t
|
||||
fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt)
|
||||
{
|
||||
struct timeval now, timeout, wait;
|
||||
struct timeval now, timeout, delta;
|
||||
fd_set writefds;
|
||||
ssize_t wlen, total;
|
||||
int r;
|
||||
@ -519,19 +519,19 @@ fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt)
|
||||
while (fetchTimeout && !FD_ISSET(conn->sd, &writefds)) {
|
||||
FD_SET(conn->sd, &writefds);
|
||||
gettimeofday(&now, NULL);
|
||||
wait.tv_sec = timeout.tv_sec - now.tv_sec;
|
||||
wait.tv_usec = timeout.tv_usec - now.tv_usec;
|
||||
if (wait.tv_usec < 0) {
|
||||
wait.tv_usec += 1000000;
|
||||
wait.tv_sec--;
|
||||
delta.tv_sec = timeout.tv_sec - now.tv_sec;
|
||||
delta.tv_usec = timeout.tv_usec - now.tv_usec;
|
||||
if (delta.tv_usec < 0) {
|
||||
delta.tv_usec += 1000000;
|
||||
delta.tv_sec--;
|
||||
}
|
||||
if (wait.tv_sec < 0) {
|
||||
if (delta.tv_sec < 0) {
|
||||
errno = ETIMEDOUT;
|
||||
fetch_syserr();
|
||||
return (-1);
|
||||
}
|
||||
errno = 0;
|
||||
r = select(conn->sd + 1, NULL, &writefds, NULL, &wait);
|
||||
r = select(conn->sd + 1, NULL, &writefds, NULL, &delta);
|
||||
if (r == -1) {
|
||||
if (errno == EINTR && fetchRestartCalls)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user