]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sys/unix/fs.rs
Rollup merge of #105694 - ouz-a:issue_105689, r=estebank
[rust.git] / library / std / src / sys / unix / fs.rs
index e4643880690595c6357badd4f3822801dc7fa32e..818914a2df074d3f3d0ba46a57ef805f42dc6347 100644 (file)
@@ -560,7 +560,7 @@ pub fn is_symlink(&self) -> bool {
     }
 
     pub fn is(&self, mode: mode_t) -> bool {
-        self.mode & libc::S_IFMT == mode
+        self.masked() == mode
     }
 
     fn masked(&self) -> mode_t {
@@ -1759,8 +1759,13 @@ mod remove_dir_impl {
     use crate::sys::common::small_c_string::run_path_with_cstr;
     use crate::sys::{cvt, cvt_r};
 
-    #[cfg(not(all(target_os = "macos", not(target_arch = "aarch64")),))]
+    #[cfg(not(any(
+        target_os = "linux",
+        all(target_os = "macos", not(target_arch = "aarch64"))
+    )))]
     use libc::{fdopendir, openat, unlinkat};
+    #[cfg(target_os = "linux")]
+    use libc::{fdopendir, openat64 as openat, unlinkat};
     #[cfg(all(target_os = "macos", not(target_arch = "aarch64")))]
     use macos_weak::{fdopendir, openat, unlinkat};