let result = unsafe { fuse_session_mount(mount.fuse_session, mnt.as_ptr()) };
if result != 0 {
return Err(io::Error::last_os_error());
}
fuse_session_mount() may fail with -1 but it doesn't set errno, thus Err("Success") is returned. This is a bit unfortunate and confusing.
I may send a PR next days that checks if io::Error::last_os_error() is 'Success' and in that case falls back to ErrorKind::Other to have at least some valid error. Since this comes from the fuse library nothing more we can do. If upstream fixes this (I may investigate and open an issue there) this will be fixed here too.
On another note: 'fuse_session_mount()' barfs a message to stderr about the possible problem:
$ mkdir broken_mountpoint
$ chmod 0000 broken_mountpoint
$ myfilesystem broken_mountpoint/
fusermount3: failed to chdir to mountpoint: Permission denied
in fuse3.rs:29:
fuse_session_mount() may fail with -1 but it doesn't set errno, thus Err("Success") is returned. This is a bit unfortunate and confusing.
I may send a PR next days that checks if io::Error::last_os_error() is 'Success' and in that case falls back to ErrorKind::Other to have at least some valid error. Since this comes from the fuse library nothing more we can do. If upstream fixes this (I may investigate and open an issue there) this will be fixed here too.
On another note: 'fuse_session_mount()' barfs a message to stderr about the possible problem:
¯\(ツ)/¯