refactor
Some checks are pending
BlockStorage/repertory_linux_builds/pipeline/head Build queued...
BlockStorage/repertory_osx_builds/pipeline/head This commit looks good

This commit is contained in:
2023-11-18 18:19:57 -06:00
parent cb0dde2a80
commit 8555d31ddf
2 changed files with 10 additions and 12 deletions

View File

@@ -1242,7 +1242,7 @@ auto fuse_drive::truncate_impl(std::string api_path, off_t size) -> api_error {
return res;
}
open_file_data ofd = O_RDWR;
open_file_data ofd{O_RDWR};
std::uint64_t handle{};
std::shared_ptr<i_open_file> open_file;
if ((res = fm_->open(api_path, false, ofd, handle, open_file)) !=
@@ -1250,12 +1250,10 @@ auto fuse_drive::truncate_impl(std::string api_path, off_t size) -> api_error {
return res;
}
const auto cleanup = [this, &handle](const api_error &err) -> api_error {
fm_->close(handle);
return err;
};
res = open_file->resize(static_cast<std::uint64_t>(size));
fm_->close(handle);
return cleanup(open_file->resize(static_cast<std::uint64_t>(size)));
return res;
}
auto fuse_drive::unlink_impl(std::string api_path) -> api_error {