Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ensure_last_os_error() with libfuse2 #218

Merged
merged 1 commit into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mnt/fuse2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{fuse2_sys::*, with_fuse_args, MountOption};
use super::{ensure_last_os_error, fuse2_sys::*, with_fuse_args, MountOption};
use log::warn;
use std::{
ffi::CString,
Expand All @@ -19,7 +19,7 @@ impl Mount {
with_fuse_args(options, |args| {
let fd = unsafe { fuse_mount_compat25(mountpoint.as_ptr(), args) };
if fd < 0 {
Err(io::Error::last_os_error())
Err(ensure_last_os_error())
} else {
let file = unsafe { File::from_raw_fd(fd) };
Ok((Arc::new(file), Mount { mountpoint }))
Expand Down
1 change: 0 additions & 1 deletion src/mnt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ fn is_mounted(fuse_device: &File) -> bool {
}

/// Ensures that an os error is never 0/Success
#[cfg(feature = "libfuse3")]
fn ensure_last_os_error() -> io::Error {
let err = io::Error::last_os_error();
match err.raw_os_error() {
Expand Down