diff --git a/src/mnt/fuse2.rs b/src/mnt/fuse2.rs index cca8c093..ad863360 100644 --- a/src/mnt/fuse2.rs +++ b/src/mnt/fuse2.rs @@ -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, @@ -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 })) diff --git a/src/mnt/mod.rs b/src/mnt/mod.rs index 43250031..205bde20 100644 --- a/src/mnt/mod.rs +++ b/src/mnt/mod.rs @@ -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() {