Skip to content

Commit a86efbc

Browse files
authored
Fix test_symlink on pre-statx Linux kernels. (#743)
Use the correct flags in the `lstat` function to suppress following of symlinks, in the path where `statx` is unavailable.
1 parent 1bf938c commit a86efbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/libc/fs/syscalls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
572572
StatxFlags::BASIC_STATS,
573573
) {
574574
Ok(x) => statx_to_stat(x),
575-
Err(io::Errno::NOSYS) => statat_old(crate::fs::CWD, path, AtFlags::empty()),
575+
Err(io::Errno::NOSYS) => statat_old(crate::fs::CWD, path, AtFlags::SYMLINK_NOFOLLOW),
576576
Err(err) => Err(err),
577577
}
578578
}

0 commit comments

Comments
 (0)