cleanup
All checks were successful
BlockStorage/repertory_osx_builds/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2023-11-18 19:23:52 -06:00
parent 9c917a9119
commit 144683d7b3

View File

@ -351,9 +351,9 @@ auto fuse_drive::fsync_impl(std::string /*api_path*/, int datasync,
return open_file->native_operation([&datasync](int handle) -> api_error { return open_file->native_operation([&datasync](int handle) -> api_error {
if (handle != REPERTORY_INVALID_HANDLE) { if (handle != REPERTORY_INVALID_HANDLE) {
#ifdef __APPLE__ #ifdef __APPLE__
if ((datasync ? fcntl(handle, F_FULLFSYNC) : fsync(handle)) == -1) { if ((datasync == 0 ? fsync(handle) : fcntl(handle, F_FULLFSYNC)) == -1) {
#else // __APPLE__ #else // __APPLE__
if ((datasync ? fdatasync(handle) : fsync(handle)) == -1) { if ((datasync == 0 ? fsync(handle) : fdatasync(handle)) == -1) {
#endif // __APPLE__ #endif // __APPLE__
return api_error::os_error; return api_error::os_error;
} }
@ -682,15 +682,9 @@ auto fuse_drive::read_impl(std::string api_path, char *buffer, size_t read_size,
return res; return res;
} }
// event_system::instance().raise<debug_log>(
// __FUNCTION__, api_path, std::to_string(read_size) + ':' +
// std::to_string(read_offset));
data_buffer data; data_buffer data;
res = res =
open_file->read(read_size, static_cast<std::uint64_t>(read_offset), data); open_file->read(read_size, static_cast<std::uint64_t>(read_offset), data);
// event_system::instance().raise<debug_log>(
// __FUNCTION__, api_path, std::to_string(bytes_read) + ':' +
// api_error_to_string(res));
if ((bytes_read = data.size()) != 0U) { if ((bytes_read = data.size()) != 0U) {
std::memcpy(buffer, data.data(), data.size()); std::memcpy(buffer, data.data(), data.size());
data.clear(); data.clear();