From cd538566d30292a9fea5ffe07d33b07d87b4c5cb Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Thu, 17 Oct 2024 16:34:32 -0500 Subject: [PATCH] updated build system --- support/include/utils/db/sqlite/db_common.hpp | 4 ++++ support/src/utils/file_directory.cpp | 3 +-- support/src/utils/file_smb_directory.cpp | 8 ++++---- support/src/utils/file_smb_file.cpp | 8 ++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/support/include/utils/db/sqlite/db_common.hpp b/support/include/utils/db/sqlite/db_common.hpp index 5669b6ba..41ca1474 100644 --- a/support/include/utils/db/sqlite/db_common.hpp +++ b/support/include/utils/db/sqlite/db_common.hpp @@ -31,7 +31,11 @@ using db_types_t = std::variant; struct sqlite3_deleter { void operator()(sqlite3 *db3) const { if (db3 != nullptr) { +#if defined(_WIN32) sqlite3_close(db3); +#else // !defined(_WIN32) + sqlite3_close_v2(db3); +#endif // defined(_WIN32) } } }; diff --git a/support/src/utils/file_directory.cpp b/support/src/utils/file_directory.cpp index a15c9090..6afe4a5a 100644 --- a/support/src/utils/file_directory.cpp +++ b/support/src/utils/file_directory.cpp @@ -161,7 +161,7 @@ auto directory::create_directory(std::string_view path) const std::string{abs_path} + '|' + std::to_string(res)); } -#else // !defined(_WIN32) +#else // !defined(_WIN32) auto ret{true}; auto paths = utils::string::split(abs_path, utils::path::directory_seperator, false); @@ -169,7 +169,6 @@ auto directory::create_directory(std::string_view path) const std::string current_path; for (std::size_t idx = 0U; !is_stop_requested() && ret && (idx < paths.size()); ++idx) { - if (paths.at(idx).empty()) { current_path = utils::path::directory_seperator; continue; diff --git a/support/src/utils/file_smb_directory.cpp b/support/src/utils/file_smb_directory.cpp index 652baf71..cb223bf7 100644 --- a/support/src/utils/file_smb_directory.cpp +++ b/support/src/utils/file_smb_directory.cpp @@ -569,11 +569,11 @@ auto smb_directory::remove() -> bool { throw std::runtime_error("session not found|" + path_); } - if (not exists()) { - return true; - } - return utils::retry_action([this]() -> bool { + if (not exists()) { + return true; + } + try { auto res = smb_directory_rm(session_.get(), tid_, smb_create_relative_path(path_).c_str()); diff --git a/support/src/utils/file_smb_file.cpp b/support/src/utils/file_smb_file.cpp index 880f269e..1bd669c1 100644 --- a/support/src/utils/file_smb_file.cpp +++ b/support/src/utils/file_smb_file.cpp @@ -304,13 +304,13 @@ auto smb_file::remove() -> bool { REPERTORY_USES_FUNCTION_NAME(); try { - if (not exists()) { - return true; - } - close(); return utils::retry_action([this]() -> bool { + if (not exists()) { + return true; + } + try { auto res = smb_tree_connect(session_.get(), share_name_.c_str(), &tid_); if (res != DSM_SUCCESS) {