From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- third_party/rust/nix/src/dir.rs | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'third_party/rust/nix/src/dir.rs') diff --git a/third_party/rust/nix/src/dir.rs b/third_party/rust/nix/src/dir.rs index 96a5843bc6..ab70f064cc 100644 --- a/third_party/rust/nix/src/dir.rs +++ b/third_party/rust/nix/src/dir.rs @@ -44,7 +44,7 @@ impl Dir { /// Opens the given path as with `fcntl::openat`. pub fn openat( - dirfd: RawFd, + dirfd: Option, path: &P, oflag: OFlag, mode: sys::stat::Mode, @@ -225,16 +225,13 @@ impl Entry { pub fn ino(&self) -> u64 { cfg_if! { if #[cfg(any(target_os = "aix", - target_os = "android", target_os = "emscripten", target_os = "fuchsia", target_os = "haiku", - target_os = "illumos", - target_os = "ios", - target_os = "l4re", - target_os = "linux", - target_os = "macos", - target_os = "solaris"))] { + target_os = "hurd", + solarish, + linux_android, + apple_targets))] { self.0.d_ino as u64 } else { u64::from(self.0.d_fileno) @@ -253,12 +250,7 @@ impl Entry { /// notably, some Linux filesystems don't implement this. The caller should use `stat` or /// `fstat` if this returns `None`. pub fn file_type(&self) -> Option { - #[cfg(not(any( - target_os = "aix", - target_os = "illumos", - target_os = "solaris", - target_os = "haiku" - )))] + #[cfg(not(any(solarish, target_os = "aix", target_os = "haiku")))] match self.0.d_type { libc::DT_FIFO => Some(Type::Fifo), libc::DT_CHR => Some(Type::CharacterDevice), @@ -271,12 +263,7 @@ impl Entry { } // illumos, Solaris, and Haiku systems do not have the d_type member at all: - #[cfg(any( - target_os = "aix", - target_os = "illumos", - target_os = "solaris", - target_os = "haiku" - ))] + #[cfg(any(solarish, target_os = "aix", target_os = "haiku"))] None } } -- cgit v1.2.3