refactor
This commit is contained in:
@ -465,14 +465,16 @@ auto remote_server::fuse_read(
|
|||||||
res = -1;
|
res = -1;
|
||||||
errno = ERANGE;
|
errno = ERANGE;
|
||||||
} else if ((res = has_compat_open_info(handle, EBADF)) == 0) {
|
} else if ((res = has_compat_open_info(handle, EBADF)) == 0) {
|
||||||
res = lseek(handle, read_offset, SEEK_SET);
|
res = lseek(static_cast<int>(handle), static_cast<long>(read_offset),
|
||||||
|
SEEK_SET);
|
||||||
if (res != -1) {
|
if (res != -1) {
|
||||||
data.resize(read_size);
|
data.resize(read_size);
|
||||||
res = read(handle, data.data(), data.size());
|
res = read(static_cast<int>(handle), data.data(),
|
||||||
|
static_cast<unsigned int>(data.size()));
|
||||||
if (res == -1) {
|
if (res == -1) {
|
||||||
data.resize(0U);
|
data.resize(0U);
|
||||||
} else if (data.size() != res) {
|
} else if (data.size() != static_cast<std::size_t>(res)) {
|
||||||
data.resize(res);
|
data.resize(static_cast<std::size_t>(res));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -517,11 +519,13 @@ auto remote_server::fuse_write(
|
|||||||
} else {
|
} else {
|
||||||
res = has_compat_open_info(handle, EBADF);
|
res = has_compat_open_info(handle, EBADF);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
res = lseek(handle, write_offset, SEEK_SET);
|
res = lseek(static_cast<int>(handle), static_cast<long>(write_offset),
|
||||||
|
SEEK_SET);
|
||||||
if (res != -1) {
|
if (res != -1) {
|
||||||
res = write(handle, buffer, write_size);
|
res = write(static_cast<int>(handle), buffer,
|
||||||
if (res >= -1) {
|
static_cast<unsigned int>(write_size));
|
||||||
bytes_written = res;
|
if (res != -1) {
|
||||||
|
bytes_written = static_cast<std::size_t>(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user