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