fixes
This commit is contained in:
		| @@ -23,6 +23,7 @@ | |||||||
|  |  | ||||||
| #include "events/event_system.hpp" | #include "events/event_system.hpp" | ||||||
| #include "events/events.hpp" | #include "events/events.hpp" | ||||||
|  | #include "platform/platform.hpp" | ||||||
| #include "utils/error_utils.hpp" | #include "utils/error_utils.hpp" | ||||||
|  |  | ||||||
| namespace repertory { | namespace repertory { | ||||||
|   | |||||||
| @@ -21,9 +21,11 @@ | |||||||
| */ | */ | ||||||
| #include "comm/packet/packet_client.hpp" | #include "comm/packet/packet_client.hpp" | ||||||
|  |  | ||||||
| #include "events/events.hpp" | #include "events/event_system.hpp" | ||||||
|  | #include "platform/platform.hpp" | ||||||
| #include "types/repertory.hpp" | #include "types/repertory.hpp" | ||||||
| #include "utils/collection.hpp" | #include "utils/collection.hpp" | ||||||
|  | #include "utils/common.hpp" | ||||||
| #include "utils/error_utils.hpp" | #include "utils/error_utils.hpp" | ||||||
| #include "utils/timeout.hpp" | #include "utils/timeout.hpp" | ||||||
| #include "version.hpp" | #include "version.hpp" | ||||||
|   | |||||||
| @@ -24,10 +24,9 @@ | |||||||
| #include "comm/packet/packet.hpp" | #include "comm/packet/packet.hpp" | ||||||
| #include "events/event_system.hpp" | #include "events/event_system.hpp" | ||||||
| #include "events/events.hpp" | #include "events/events.hpp" | ||||||
|  | #include "platform/platform.hpp" | ||||||
| #include "types/repertory.hpp" | #include "types/repertory.hpp" | ||||||
| #include "utils/error_utils.hpp" | #include "utils/error_utils.hpp" | ||||||
| #include "utils/string.hpp" |  | ||||||
| #include "utils/utils.hpp" |  | ||||||
|  |  | ||||||
| namespace repertory { | namespace repertory { | ||||||
| using std::thread; | using std::thread; | ||||||
|   | |||||||
| @@ -28,12 +28,11 @@ | |||||||
| #include "events/event_system.hpp" | #include "events/event_system.hpp" | ||||||
| #include "events/events.hpp" | #include "events/events.hpp" | ||||||
| #include "initialize.hpp" | #include "initialize.hpp" | ||||||
| #include "providers/i_provider.hpp" | #include "platform/platform.hpp" | ||||||
| #include "utils/collection.hpp" | #include "utils/collection.hpp" | ||||||
| #include "utils/file_utils.hpp" | #include "utils/file_utils.hpp" | ||||||
| #include "utils/path.hpp" | #include "utils/path.hpp" | ||||||
| #include "utils/string.hpp" | #include "utils/string.hpp" | ||||||
| #include "utils/utils.hpp" |  | ||||||
|  |  | ||||||
| namespace repertory { | namespace repertory { | ||||||
| auto fuse_base::instance() -> fuse_base & { | auto fuse_base::instance() -> fuse_base & { | ||||||
|   | |||||||
| @@ -27,7 +27,6 @@ | |||||||
| #include "drives/directory_cache.hpp" | #include "drives/directory_cache.hpp" | ||||||
| #include "drives/directory_iterator.hpp" | #include "drives/directory_iterator.hpp" | ||||||
| #include "drives/eviction.hpp" | #include "drives/eviction.hpp" | ||||||
| #include "drives/fuse/events.hpp" |  | ||||||
| #include "drives/fuse/remotefuse/remote_server.hpp" | #include "drives/fuse/remotefuse/remote_server.hpp" | ||||||
| #include "events/consumers/console_consumer.hpp" | #include "events/consumers/console_consumer.hpp" | ||||||
| #include "events/consumers/logging_consumer.hpp" | #include "events/consumers/logging_consumer.hpp" | ||||||
| @@ -41,7 +40,6 @@ | |||||||
| #include "utils/base64.hpp" | #include "utils/base64.hpp" | ||||||
| #include "utils/collection.hpp" | #include "utils/collection.hpp" | ||||||
| #include "utils/error_utils.hpp" | #include "utils/error_utils.hpp" | ||||||
| #include "utils/file_utils.hpp" |  | ||||||
| #include "utils/polling.hpp" | #include "utils/polling.hpp" | ||||||
| #include "utils/time.hpp" | #include "utils/time.hpp" | ||||||
| #include "utils/utils.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)); |                                    std::to_string(flags)); | ||||||
|   }); |   }); | ||||||
| } | } | ||||||
| #endif // __APPLE__ | #endif // defined(__APPLE__) | ||||||
|  |  | ||||||
| #if FUSE_USE_VERSION >= 30 | #if FUSE_USE_VERSION >= 30 | ||||||
| auto fuse_drive::chmod_impl(std::string api_path, mode_t mode, | auto fuse_drive::chmod_impl(std::string api_path, mode_t mode, | ||||||
|                             struct fuse_file_info * /*file_info*/) |                             struct fuse_file_info * /*file_info*/) | ||||||
|     -> api_error { |     -> api_error { | ||||||
| #else | #else  // FUSE_USE_VERSION < 30 | ||||||
| auto fuse_drive::chmod_impl(std::string api_path, mode_t mode) -> api_error { | 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 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)); |     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(); |       const auto now = utils::time::get_file_time_now(); | ||||||
| #if defined(__APPLE__) | #if defined(__APPLE__) | ||||||
|       const auto osx_flags = static_cast<std::uint32_t>(file_info->flags); |       const auto osx_flags = static_cast<std::uint32_t>(file_info->flags); | ||||||
| #else | #else  // !defined(__APPLE__) | ||||||
|       const auto osx_flags = 0U; |       const auto osx_flags = 0U; | ||||||
| #endif | #endif // defined(__APPLE__) | ||||||
|  |  | ||||||
|       auto meta = create_meta_attributes( |       auto meta = create_meta_attributes( | ||||||
|           now, FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_ARCHIVE, now, now, |           now, FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_ARCHIVE, now, now, | ||||||
|   | |||||||
| @@ -24,20 +24,15 @@ | |||||||
| #include "drives/fuse/remotefuse/remote_server.hpp" | #include "drives/fuse/remotefuse/remote_server.hpp" | ||||||
|  |  | ||||||
| #include "app_config.hpp" | #include "app_config.hpp" | ||||||
| #include "comm/packet/client_pool.hpp" |  | ||||||
| #include "comm/packet/packet.hpp" | #include "comm/packet/packet.hpp" | ||||||
| #include "comm/packet/packet_server.hpp" |  | ||||||
| #include "drives/directory_iterator.hpp" | #include "drives/directory_iterator.hpp" | ||||||
| #include "drives/fuse/remotefuse/i_remote_instance.hpp" |  | ||||||
| #include "drives/remote/remote_open_file_table.hpp" | #include "drives/remote/remote_open_file_table.hpp" | ||||||
| #include "drives/winfsp/remotewinfsp/i_remote_instance.hpp" |  | ||||||
| #include "events/event_system.hpp" | #include "events/event_system.hpp" | ||||||
| #include "events/events.hpp" | #include "platform/platform.hpp" | ||||||
| #include "types/remote.hpp" | #include "types/remote.hpp" | ||||||
| #include "types/repertory.hpp" | #include "types/repertory.hpp" | ||||||
| #include "utils/base64.hpp" |  | ||||||
| #include "utils/error_utils.hpp" | #include "utils/error_utils.hpp" | ||||||
| #include "utils/file_utils.hpp" | #include "utils/file.hpp" | ||||||
| #include "utils/path.hpp" | #include "utils/path.hpp" | ||||||
| #include "utils/time.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); |                         (unix_st.st_ctimespec.tv_sec * NANOS_PER_SECOND); | ||||||
|   r_stat.st_mtimespec = unix_st.st_mtimespec.tv_nsec + |   r_stat.st_mtimespec = unix_st.st_mtimespec.tv_nsec + | ||||||
|                         (unix_st.st_mtimespec.tv_sec * NANOS_PER_SECOND); |                         (unix_st.st_mtimespec.tv_sec * NANOS_PER_SECOND); | ||||||
| #else | #else  // !defined(__APPLE__) | ||||||
|   r_stat.st_flags = 0; |   r_stat.st_flags = 0; | ||||||
|  |  | ||||||
|   r_stat.st_atimespec = static_cast<remote::file_time>( |   r_stat.st_atimespec = static_cast<remote::file_time>( | ||||||
| @@ -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)); |       unix_st.st_ctim.tv_nsec + (unix_st.st_ctim.tv_sec * NANOS_PER_SECOND)); | ||||||
|   r_stat.st_mtimespec = static_cast<remote::file_time>( |   r_stat.st_mtimespec = static_cast<remote::file_time>( | ||||||
|       unix_st.st_mtim.tv_nsec + (unix_st.st_mtim.tv_sec * NANOS_PER_SECOND)); |       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<remote::block_size>(unix_st.st_blksize); |   r_stat.st_blksize = static_cast<remote::block_size>(unix_st.st_blksize); | ||||||
|   r_stat.st_blocks = static_cast<remote::block_count>(unix_st.st_blocks); |   r_stat.st_blocks = static_cast<remote::block_count>(unix_st.st_blocks); | ||||||
|   r_stat.st_gid = unix_st.st_gid; |   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__) | #if defined(__APPLE__) | ||||||
|     res = datasync ? fcntl(static_cast<native_handle>(handle), F_FULLFSYNC) |     res = datasync ? fcntl(static_cast<native_handle>(handle), F_FULLFSYNC) | ||||||
|                    : fsync(static_cast<native_handle>(handle)); |                    : fsync(static_cast<native_handle>(handle)); | ||||||
| #else | #else  // !defined(__APPLE__) | ||||||
|     res = datasync ? fdatasync(static_cast<native_handle>(handle)) |     res = datasync ? fdatasync(static_cast<native_handle>(handle)) | ||||||
|                    : fsync(static_cast<native_handle>(handle)); |                    : fsync(static_cast<native_handle>(handle)); | ||||||
| #endif | #endif // defined(__APPLE__) | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   auto ret = ((res < 0) ? -errno : 0); |   auto ret = ((res < 0) ? -errno : 0); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user