diff --git a/src/uu/tail/src/platform/unix.rs b/src/uu/tail/src/platform/unix.rs index e01d5e444..7ddf6edd0 100644 --- a/src/uu/tail/src/platform/unix.rs +++ b/src/uu/tail/src/platform/unix.rs @@ -54,7 +54,7 @@ pub fn stdin_is_pipe_or_fifo() -> bool { fd >= 0 // GNU tail checks fd >= 0 && match fstat(fd) { Ok(stat) => { - let mode = stat.st_mode; + let mode = stat.st_mode as libc::mode_t; // NOTE: This is probably not the most correct way to check this (mode & S_IFIFO != 0) || (mode & S_IFSOCK != 0) } diff --git a/src/uu/wc/src/count_fast.rs b/src/uu/wc/src/count_fast.rs index f0aa311a0..555225a06 100644 --- a/src/uu/wc/src/count_fast.rs +++ b/src/uu/wc/src/count_fast.rs @@ -36,7 +36,7 @@ fn count_bytes_using_splice(fd: &impl AsRawFd) -> Result { .map_err(|_| 0_usize)?; let null_rdev = stat::fstat(null_file.as_raw_fd()) .map_err(|_| 0_usize)? - .st_rdev; + .st_rdev as libc::dev_t; if unsafe { (libc::major(null_rdev), libc::minor(null_rdev)) } != (1, 3) { // This is not a proper /dev/null, writing to it is probably bad // Bit of an edge case, but it has been known to happen @@ -86,14 +86,14 @@ pub(crate) fn count_bytes_fast(handle: &mut T) -> (usize, Opti // The second case happens for files in pseudo-filesystems. For // example with /proc/version and /sys/kernel/profiling. So, // if it is 0 we don't report that and instead do a full read. - if (stat.st_mode & S_IFREG) != 0 && stat.st_size > 0 { + if (stat.st_mode as libc::mode_t & S_IFREG) != 0 && stat.st_size > 0 { return (stat.st_size as usize, None); } #[cfg(any(target_os = "linux", target_os = "android"))] { // Else, if we're on Linux and our file is a FIFO pipe // (or stdin), we use splice to count the number of bytes. - if (stat.st_mode & S_IFIFO) != 0 { + if (stat.st_mode as libc::mode_t & S_IFIFO) != 0 { match count_bytes_using_splice(handle) { Ok(n) => return (n, None), Err(n) => byte_count = n, diff --git a/src/uu/yes/src/splice.rs b/src/uu/yes/src/splice.rs index f77a09ed6..a0d41e06f 100644 --- a/src/uu/yes/src/splice.rs +++ b/src/uu/yes/src/splice.rs @@ -23,7 +23,7 @@ use nix::{errno::Errno, libc::S_IFIFO, sys::stat::fstat}; use uucore::pipes::{pipe, splice_exact, vmsplice}; pub(crate) fn splice_data(bytes: &[u8], out: &impl AsRawFd) -> Result<()> { - let is_pipe = fstat(out.as_raw_fd())?.st_mode & S_IFIFO != 0; + let is_pipe = fstat(out.as_raw_fd())?.st_mode as nix::libc::mode_t & S_IFIFO != 0; if is_pipe { loop { diff --git a/src/uucore/src/lib/features/entries.rs b/src/uucore/src/lib/features/entries.rs index 03c5a56cf..561de888b 100644 --- a/src/uucore/src/lib/features/entries.rs +++ b/src/uucore/src/lib/features/entries.rs @@ -183,7 +183,13 @@ impl Passwd { name: cstr2string(raw.pw_name).expect("passwd without name"), uid: raw.pw_uid, gid: raw.pw_gid, + #[cfg(not(all( + target_os = "android", + any(target_arch = "x86", target_arch = "arm") + )))] user_info: cstr2string(raw.pw_gecos), + #[cfg(all(target_os = "android", any(target_arch = "x86", target_arch = "arm")))] + user_info: None, user_shell: cstr2string(raw.pw_shell), user_dir: cstr2string(raw.pw_dir), user_passwd: cstr2string(raw.pw_passwd), diff --git a/tests/common/util.rs b/tests/common/util.rs index dc6aa78e7..8912a484a 100644 --- a/tests/common/util.rs +++ b/tests/common/util.rs @@ -670,7 +670,7 @@ impl AtPath { let name = CString::new(self.plus_as_string(fifo)).unwrap(); let mut stat: libc::stat = std::mem::zeroed(); if libc::stat(name.as_ptr(), &mut stat) >= 0 { - libc::S_IFIFO & stat.st_mode != 0 + libc::S_IFIFO & stat.st_mode as libc::mode_t != 0 } else { false }