refactor
This commit is contained in:
@ -148,7 +148,8 @@ void remote_server::populate_file_info(const std::string &api_path,
|
||||
|
||||
void remote_server::populate_stat(const struct stat64 &unix_st,
|
||||
remote::stat &r_stat) {
|
||||
memset(&r_stat, 0, sizeof(r_stat));
|
||||
r_stat = {};
|
||||
|
||||
#if defined(__APPLE__)
|
||||
r_stat.st_flags = unix_st.st_flags;
|
||||
|
||||
@ -327,8 +328,9 @@ auto remote_server::fuse_fgetattr(
|
||||
static_cast<const char *>(__FUNCTION__),
|
||||
};
|
||||
|
||||
r_stat = {};
|
||||
|
||||
const auto file_path = construct_path(path);
|
||||
memset(&r_stat, 0, sizeof(remote::stat));
|
||||
|
||||
auto res = has_open_info(static_cast<native_handle>(handle), EBADF);
|
||||
if (res == 0) {
|
||||
@ -496,7 +498,8 @@ auto remote_server::fuse_getattr(const char *path, remote::stat &r_stat,
|
||||
const auto api_path = utils::path::create_api_path(path);
|
||||
const auto file_path = construct_path(api_path);
|
||||
const auto parent_api_path = utils::path::get_parent_api_path(api_path);
|
||||
memset(&r_stat, 0, sizeof(remote::stat));
|
||||
|
||||
r_stat = {};
|
||||
|
||||
directory = utils::file::directory(file_path).exists();
|
||||
|
||||
@ -959,7 +962,7 @@ auto remote_server::fuse_statfs_x(const char *path, std::uint64_t bsize,
|
||||
r_stat.f_blocks ? (r_stat.f_blocks - used_blocks) : 0;
|
||||
r_stat.f_ffree = r_stat.f_favail =
|
||||
r_stat.f_files - drive_.get_total_item_count();
|
||||
std::memset(r_stat.f_mntfromname.data(), 0, r_stat.f_mntfromname.data());
|
||||
std::memset(r_stat.f_mntfromname.data(), 0, r_stat.f_mntfromname.size());
|
||||
strncpy(r_stat.f_mntfromname.data(),
|
||||
(utils::create_volume_label(config_.get_provider_type())).c_str(),
|
||||
r_stat.f_mntfromname.size() - 1U);
|
||||
|
Reference in New Issue
Block a user