fixes
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit

This commit is contained in:
Scott E. Graves 2024-10-26 21:27:35 -05:00
parent 55debcb643
commit 0650790c43

View File

@ -733,29 +733,25 @@ auto winfsp_drive::Overwrite(PVOID /*file_node*/, PVOID file_desc,
api_meta_map meta{}; api_meta_map meta{};
error = provider_.get_item_meta(api_path, meta); error = provider_.get_item_meta(api_path, meta);
if (error == api_error::success) { if (error == api_error::success) {
error = api_error::file_in_use; error = file->resize(0U);
if (not fm_->is_processing(api_path)) { if (error == api_error::success) {
error = file->resize(0U); filesystem_item existing_fsi{};
error = provider_.get_filesystem_item(api_path, false, existing_fsi);
if (error == api_error::success) { if (error == api_error::success) {
filesystem_item existing_fsi{}; // Handle replace attributes
error = if (replace_attributes != 0U) {
provider_.get_filesystem_item(api_path, false, existing_fsi); if (attributes == 0U || attributes == FILE_ATTRIBUTE_NORMAL) {
if (error == api_error::success) { attributes = FILE_ATTRIBUTE_ARCHIVE;
// Handle replace attributes }
if (replace_attributes != 0U) { meta[META_ATTRIBUTES] = std::to_string(attributes);
if (attributes == 0U) { error = provider_.set_item_meta(api_path, meta);
attributes = FILE_ATTRIBUTE_ARCHIVE; } else if (attributes != 0U) { // Handle merge attributes
} const auto current_attributes =
meta[META_ATTRIBUTES] = std::to_string(attributes); utils::get_attributes_from_meta(meta);
const auto merged_attributes = attributes | current_attributes;
if (merged_attributes != current_attributes) {
meta[META_ATTRIBUTES] = std::to_string(merged_attributes);
error = provider_.set_item_meta(api_path, meta); error = provider_.set_item_meta(api_path, meta);
} else if (attributes != 0U) { // Handle merge attributes
const auto current_attributes =
utils::get_attributes_from_meta(meta);
const auto merged_attributes = attributes | current_attributes;
if (merged_attributes != current_attributes) {
meta[META_ATTRIBUTES] = std::to_string(merged_attributes);
error = provider_.set_item_meta(api_path, meta);
}
} }
} }
} }