fix macos deadlock
This commit is contained in:
@@ -398,24 +398,27 @@ auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf,
|
||||
api_path.c_str(), static_cast<remote::file_offset>(offset),
|
||||
f_info->fh, item_path)) == 0) {
|
||||
std::unique_ptr<struct stat> p_stat{nullptr};
|
||||
int stat_res{0};
|
||||
if ((item_path == ".") || (item_path == "..")) {
|
||||
auto stat_res{api_error::success};
|
||||
p_stat = std::make_unique<struct stat>();
|
||||
std::memset(p_stat.get(), 0, sizeof(struct stat));
|
||||
if (item_path == ".") {
|
||||
stat_res =
|
||||
stat(utils::path::combine(get_mount_location(), {api_path}).c_str(),
|
||||
stat_res = getattr_impl(api_path, p_stat.get());
|
||||
} else if (api_path == "/" && get_mount_location() != "/") {
|
||||
auto local_res =
|
||||
stat(utils::path::get_parent_path(get_mount_location()).c_str(),
|
||||
p_stat.get());
|
||||
if (local_res != 0) {
|
||||
res = local_res;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
stat_res =
|
||||
stat(utils::path::get_parent_path(
|
||||
utils::path::combine(get_mount_location(), {api_path}))
|
||||
.c_str(),
|
||||
p_stat.get());
|
||||
stat_res = getattr_impl(utils::path::get_parent_api_path(api_path),
|
||||
p_stat.get());
|
||||
}
|
||||
|
||||
if (stat_res != 0) {
|
||||
res = stat_res;
|
||||
if (stat_res != api_error::success) {
|
||||
res = utils::from_api_error(stat_res);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user