mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-15 15:06:42 +00:00
Recommit the non-broken parts of 1.34 and 1.37.
Change the type and name of a variable introduced in 1.33.
This commit is contained in:
parent
cab8495092
commit
bb13d0af67
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106186
@ -364,13 +364,17 @@ _fetch_read(conn_t *conn, char *buf, size_t len)
|
||||
wait.tv_usec += 1000000;
|
||||
wait.tv_sec--;
|
||||
}
|
||||
if (wait.tv_sec < 0)
|
||||
return (rlen);
|
||||
if (wait.tv_sec < 0) {
|
||||
errno = ETIMEDOUT;
|
||||
_fetch_syserr();
|
||||
return (-1);
|
||||
}
|
||||
errno = 0;
|
||||
r = select(conn->sd + 1, &readfds, NULL, NULL, &wait);
|
||||
if (r == -1) {
|
||||
if (errno == EINTR && fetchRestartCalls)
|
||||
continue;
|
||||
_fetch_syserr();
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
@ -405,8 +409,8 @@ _fetch_getln(conn_t *conn)
|
||||
{
|
||||
char *tmp;
|
||||
size_t tmpsize;
|
||||
ssize_t len;
|
||||
char c;
|
||||
int error;
|
||||
|
||||
if (conn->buf == NULL) {
|
||||
if ((conn->buf = malloc(MIN_BUF_SIZE)) == NULL) {
|
||||
@ -420,10 +424,10 @@ _fetch_getln(conn_t *conn)
|
||||
conn->buflen = 0;
|
||||
|
||||
do {
|
||||
error = _fetch_read(conn, &c, 1);
|
||||
if (error == -1)
|
||||
len = _fetch_read(conn, &c, 1);
|
||||
if (len == -1)
|
||||
return (-1);
|
||||
else if (error == 0)
|
||||
if (len == 0)
|
||||
break;
|
||||
conn->buf[conn->buflen++] = c;
|
||||
if (conn->buflen == conn->bufsize) {
|
||||
@ -488,6 +492,7 @@ _fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt)
|
||||
}
|
||||
if (wait.tv_sec < 0) {
|
||||
errno = ETIMEDOUT;
|
||||
_fetch_syserr();
|
||||
return (-1);
|
||||
}
|
||||
errno = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user