refactor
This commit is contained in:
@@ -126,7 +126,7 @@ auto fuse_drive::chown_impl(std::string api_path, uid_t uid, gid_t gid)
|
|||||||
|
|
||||||
auto fuse_drive::create_impl(std::string api_path, mode_t mode,
|
auto fuse_drive::create_impl(std::string api_path, mode_t mode,
|
||||||
struct fuse_file_info *file_info) -> api_error {
|
struct fuse_file_info *file_info) -> api_error {
|
||||||
file_info->fh = INVALID_HANDLE_VALUE;
|
file_info->fh = static_cast<std::uint64_t>(INVALID_HANDLE_VALUE);
|
||||||
|
|
||||||
auto is_append_op = ((file_info->flags & O_APPEND) == O_APPEND);
|
auto is_append_op = ((file_info->flags & O_APPEND) == O_APPEND);
|
||||||
auto is_create_op = ((file_info->flags & O_CREAT) == O_CREAT);
|
auto is_create_op = ((file_info->flags & O_CREAT) == O_CREAT);
|
||||||
@@ -249,7 +249,7 @@ auto fuse_drive::create_impl(std::string api_path, mode_t mode,
|
|||||||
if (res != api_error::success) {
|
if (res != api_error::success) {
|
||||||
#endif // FUSE_USE_VERSION >= 30
|
#endif // FUSE_USE_VERSION >= 30
|
||||||
fm_->close(handle);
|
fm_->close(handle);
|
||||||
file_info->fh = INVALID_HANDLE_VALUE;
|
file_info->fh = static_cast<std::uint64_t>(INVALID_HANDLE_VALUE);
|
||||||
errno = std::abs(utils::from_api_error(res));
|
errno = std::abs(utils::from_api_error(res));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -696,7 +696,7 @@ auto fuse_drive::open_impl(std::string api_path,
|
|||||||
|
|
||||||
auto fuse_drive::opendir_impl(std::string api_path,
|
auto fuse_drive::opendir_impl(std::string api_path,
|
||||||
struct fuse_file_info *file_info) -> api_error {
|
struct fuse_file_info *file_info) -> api_error {
|
||||||
file_info->fh = INVALID_HANDLE_VALUE;
|
file_info->fh = static_cast<std::uint64_t>(INVALID_HANDLE_VALUE);
|
||||||
|
|
||||||
auto mask = (O_RDONLY != (file_info->flags & O_ACCMODE) ? W_OK : R_OK) | X_OK;
|
auto mask = (O_RDONLY != (file_info->flags & O_ACCMODE) ? W_OK : R_OK) | X_OK;
|
||||||
auto res = check_access(api_path, mask);
|
auto res = check_access(api_path, mask);
|
||||||
|
Reference in New Issue
Block a user