unix: rename variable for consistency
uv__fs_write_do() calls it `r` so call it that in `uv__fs_read_do()` too.
This commit is contained in:
parent
8d69f256d1
commit
8ac649e2aa
@ -407,28 +407,28 @@ static ssize_t uv__fs_read_do(int fd,
|
|||||||
unsigned int nbufs,
|
unsigned int nbufs,
|
||||||
int64_t off) {
|
int64_t off) {
|
||||||
unsigned int iovmax;
|
unsigned int iovmax;
|
||||||
ssize_t result;
|
ssize_t r;
|
||||||
|
|
||||||
iovmax = uv__getiovmax();
|
iovmax = uv__getiovmax();
|
||||||
if (nbufs > iovmax)
|
if (nbufs > iovmax)
|
||||||
nbufs = iovmax;
|
nbufs = iovmax;
|
||||||
|
|
||||||
result = 0;
|
r = 0;
|
||||||
if (off < 0) {
|
if (off < 0) {
|
||||||
if (nbufs == 1)
|
if (nbufs == 1)
|
||||||
result = read(fd, bufs->iov_base, bufs->iov_len);
|
r = read(fd, bufs->iov_base, bufs->iov_len);
|
||||||
else if (nbufs > 1)
|
else if (nbufs > 1)
|
||||||
result = readv(fd, bufs, nbufs);
|
r = readv(fd, bufs, nbufs);
|
||||||
} else {
|
} else {
|
||||||
if (nbufs == 1)
|
if (nbufs == 1)
|
||||||
result = pread(fd, bufs->iov_base, bufs->iov_len, off);
|
r = pread(fd, bufs->iov_base, bufs->iov_len, off);
|
||||||
else if (nbufs > 1)
|
else if (nbufs > 1)
|
||||||
result = preadv(fd, bufs, nbufs, off);
|
r = preadv(fd, bufs, nbufs, off);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __PASE__
|
#ifdef __PASE__
|
||||||
/* PASE returns EOPNOTSUPP when reading a directory, convert to EISDIR */
|
/* PASE returns EOPNOTSUPP when reading a directory, convert to EISDIR */
|
||||||
if (result == -1 && errno == EOPNOTSUPP) {
|
if (r == -1 && errno == EOPNOTSUPP) {
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
ssize_t rc;
|
ssize_t rc;
|
||||||
rc = uv__fstat(fd, &buf);
|
rc = uv__fstat(fd, &buf);
|
||||||
@ -438,7 +438,7 @@ static ssize_t uv__fs_read_do(int fd,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return result;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user