Skip to content

fix: Detect mounts even without /proc#1742

Open
danielzgtg wants to merge 1 commit intoeza-community:mainfrom
danielzgtg:fix/mountsWithoutProc
Open

fix: Detect mounts even without /proc#1742
danielzgtg wants to merge 1 commit intoeza-community:mainfrom
danielzgtg:fix/mountsWithoutProc

Conversation

@danielzgtg
Copy link
Copy Markdown

@danielzgtg danielzgtg commented Mar 14, 2026

The traditional way to detect mountpoints is to compare the device IDs containing the directory and its parent. mountpoint(1) uses this if it cannot open /proc/self/mountinfo.

Before

The underlines are missing when /proc is not properly mounted.

underlines missing

After

The underlines are still present without a functioning /proc.

underlines present

@danielzgtg danielzgtg force-pushed the fix/mountsWithoutProc branch 2 times, most recently from 0f22397 to e69f32b Compare March 14, 2026 23:06
Comment thread src/fs/file.rs Outdated
Comment on lines 424 to 427
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
pub fn is_mount_point(&self) -> bool {
false
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a pretty hacky introduction of complecity that was previously in the !cfg block

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I brought back the cfg! expression. But the if statement got chopped up by the #[cfg(unix)] needed to hide std::os::unix::fs::MetadataExt for the Windows build.

The traditional way to detect mountpoints is to compare the device IDs
containing the directory and its parent. mountpoint(1) uses this if it
cannot open `/proc/self/mountinfo`.
@danielzgtg danielzgtg force-pushed the fix/mountsWithoutProc branch from e69f32b to db9744b Compare March 16, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants