From 05d5bd9fe52a4ca8ba7b77c3e2ef3d9a28b15231 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Fri, 2 Aug 2024 14:46:01 -0500 Subject: [PATCH] fixes --- .../src/comm/packet/client_pool.cpp | 1 + .../src/comm/packet/packet_client.cpp | 4 +++- .../src/comm/packet/packet_server.cpp | 3 +-- .../librepertory/src/drives/fuse/fuse_base.cpp | 3 +-- .../librepertory/src/drives/fuse/fuse_drive.cpp | 12 +++++------- .../drives/fuse/remotefuse/remote_server.cpp | 17 ++++++----------- 6 files changed, 17 insertions(+), 23 deletions(-) diff --git a/repertory/librepertory/src/comm/packet/client_pool.cpp b/repertory/librepertory/src/comm/packet/client_pool.cpp index 7971ee03..2720e0ea 100644 --- a/repertory/librepertory/src/comm/packet/client_pool.cpp +++ b/repertory/librepertory/src/comm/packet/client_pool.cpp @@ -23,6 +23,7 @@ #include "events/event_system.hpp" #include "events/events.hpp" +#include "platform/platform.hpp" #include "utils/error_utils.hpp" namespace repertory { diff --git a/repertory/librepertory/src/comm/packet/packet_client.cpp b/repertory/librepertory/src/comm/packet/packet_client.cpp index 33d030ff..7826aeac 100644 --- a/repertory/librepertory/src/comm/packet/packet_client.cpp +++ b/repertory/librepertory/src/comm/packet/packet_client.cpp @@ -21,9 +21,11 @@ */ #include "comm/packet/packet_client.hpp" -#include "events/events.hpp" +#include "events/event_system.hpp" +#include "platform/platform.hpp" #include "types/repertory.hpp" #include "utils/collection.hpp" +#include "utils/common.hpp" #include "utils/error_utils.hpp" #include "utils/timeout.hpp" #include "version.hpp" diff --git a/repertory/librepertory/src/comm/packet/packet_server.cpp b/repertory/librepertory/src/comm/packet/packet_server.cpp index d3f66ae5..f3b260ee 100644 --- a/repertory/librepertory/src/comm/packet/packet_server.cpp +++ b/repertory/librepertory/src/comm/packet/packet_server.cpp @@ -24,10 +24,9 @@ #include "comm/packet/packet.hpp" #include "events/event_system.hpp" #include "events/events.hpp" +#include "platform/platform.hpp" #include "types/repertory.hpp" #include "utils/error_utils.hpp" -#include "utils/string.hpp" -#include "utils/utils.hpp" namespace repertory { using std::thread; diff --git a/repertory/librepertory/src/drives/fuse/fuse_base.cpp b/repertory/librepertory/src/drives/fuse/fuse_base.cpp index 92706a2d..97ddbcf2 100644 --- a/repertory/librepertory/src/drives/fuse/fuse_base.cpp +++ b/repertory/librepertory/src/drives/fuse/fuse_base.cpp @@ -28,12 +28,11 @@ #include "events/event_system.hpp" #include "events/events.hpp" #include "initialize.hpp" -#include "providers/i_provider.hpp" +#include "platform/platform.hpp" #include "utils/collection.hpp" #include "utils/file_utils.hpp" #include "utils/path.hpp" #include "utils/string.hpp" -#include "utils/utils.hpp" namespace repertory { auto fuse_base::instance() -> fuse_base & { diff --git a/repertory/librepertory/src/drives/fuse/fuse_drive.cpp b/repertory/librepertory/src/drives/fuse/fuse_drive.cpp index ad58e188..05521244 100644 --- a/repertory/librepertory/src/drives/fuse/fuse_drive.cpp +++ b/repertory/librepertory/src/drives/fuse/fuse_drive.cpp @@ -27,7 +27,6 @@ #include "drives/directory_cache.hpp" #include "drives/directory_iterator.hpp" #include "drives/eviction.hpp" -#include "drives/fuse/events.hpp" #include "drives/fuse/remotefuse/remote_server.hpp" #include "events/consumers/console_consumer.hpp" #include "events/consumers/logging_consumer.hpp" @@ -41,7 +40,6 @@ #include "utils/base64.hpp" #include "utils/collection.hpp" #include "utils/error_utils.hpp" -#include "utils/file_utils.hpp" #include "utils/polling.hpp" #include "utils/time.hpp" #include "utils/utils.hpp" @@ -58,15 +56,15 @@ api_error fuse_drive::chflags_impl(std::string api_path, uint32_t flags) { std::to_string(flags)); }); } -#endif // __APPLE__ +#endif // defined(__APPLE__) #if FUSE_USE_VERSION >= 30 auto fuse_drive::chmod_impl(std::string api_path, mode_t mode, struct fuse_file_info * /*file_info*/) -> api_error { -#else +#else // FUSE_USE_VERSION < 30 auto fuse_drive::chmod_impl(std::string api_path, mode_t mode) -> api_error { -#endif +#endif // FUSE_USE_VERSION >= 30 return check_and_perform(api_path, X_OK, [&](api_meta_map &) -> api_error { return provider_.set_item_meta(api_path, META_MODE, std::to_string(mode)); }); @@ -167,9 +165,9 @@ auto fuse_drive::create_impl(std::string api_path, mode_t mode, const auto now = utils::time::get_file_time_now(); #if defined(__APPLE__) const auto osx_flags = static_cast(file_info->flags); -#else +#else // !defined(__APPLE__) const auto osx_flags = 0U; -#endif +#endif // defined(__APPLE__) auto meta = create_meta_attributes( now, FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_ARCHIVE, now, now, diff --git a/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp b/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp index ba86bdf7..cc1640d0 100644 --- a/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp +++ b/repertory/librepertory/src/drives/fuse/remotefuse/remote_server.cpp @@ -24,20 +24,15 @@ #include "drives/fuse/remotefuse/remote_server.hpp" #include "app_config.hpp" -#include "comm/packet/client_pool.hpp" #include "comm/packet/packet.hpp" -#include "comm/packet/packet_server.hpp" #include "drives/directory_iterator.hpp" -#include "drives/fuse/remotefuse/i_remote_instance.hpp" #include "drives/remote/remote_open_file_table.hpp" -#include "drives/winfsp/remotewinfsp/i_remote_instance.hpp" #include "events/event_system.hpp" -#include "events/events.hpp" +#include "platform/platform.hpp" #include "types/remote.hpp" #include "types/repertory.hpp" -#include "utils/base64.hpp" #include "utils/error_utils.hpp" -#include "utils/file_utils.hpp" +#include "utils/file.hpp" #include "utils/path.hpp" #include "utils/time.hpp" @@ -164,7 +159,7 @@ void remote_server::populate_stat(const struct stat64 &unix_st, (unix_st.st_ctimespec.tv_sec * NANOS_PER_SECOND); r_stat.st_mtimespec = unix_st.st_mtimespec.tv_nsec + (unix_st.st_mtimespec.tv_sec * NANOS_PER_SECOND); -#else +#else // !defined(__APPLE__) r_stat.st_flags = 0; r_stat.st_atimespec = static_cast( @@ -175,7 +170,7 @@ void remote_server::populate_stat(const struct stat64 &unix_st, unix_st.st_ctim.tv_nsec + (unix_st.st_ctim.tv_sec * NANOS_PER_SECOND)); r_stat.st_mtimespec = static_cast( unix_st.st_mtim.tv_nsec + (unix_st.st_mtim.tv_sec * NANOS_PER_SECOND)); -#endif +#endif // defined(__APPLE__) r_stat.st_blksize = static_cast(unix_st.st_blksize); r_stat.st_blocks = static_cast(unix_st.st_blocks); r_stat.st_gid = unix_st.st_gid; @@ -450,10 +445,10 @@ auto remote_server::fuse_fsync(const char *path, const std::int32_t &datasync, #if defined(__APPLE__) res = datasync ? fcntl(static_cast(handle), F_FULLFSYNC) : fsync(static_cast(handle)); -#else +#else // !defined(__APPLE__) res = datasync ? fdatasync(static_cast(handle)) : fsync(static_cast(handle)); -#endif +#endif // defined(__APPLE__) } auto ret = ((res < 0) ? -errno : 0);