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{};
error = provider_.get_item_meta(api_path, meta);
if (error == api_error::success) {
error = api_error::file_in_use;
if (not fm_->is_processing(api_path)) {
error = file->resize(0U);
error = file->resize(0U);
if (error == api_error::success) {
filesystem_item existing_fsi{};
error = provider_.get_filesystem_item(api_path, false, existing_fsi);
if (error == api_error::success) {
filesystem_item existing_fsi{};
error =
provider_.get_filesystem_item(api_path, false, existing_fsi);
if (error == api_error::success) {
// Handle replace attributes
if (replace_attributes != 0U) {
if (attributes == 0U) {
attributes = FILE_ATTRIBUTE_ARCHIVE;
}
meta[META_ATTRIBUTES] = std::to_string(attributes);
// Handle replace attributes
if (replace_attributes != 0U) {
if (attributes == 0U || attributes == FILE_ATTRIBUTE_NORMAL) {
attributes = FILE_ATTRIBUTE_ARCHIVE;
}
meta[META_ATTRIBUTES] = std::to_string(attributes);
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);
} 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);
}
}
}
}