diff --git a/src/uu/stty/src/stty.rs b/src/uu/stty/src/stty.rs index 268c0deb668..6909d2c4f5f 100644 --- a/src/uu/stty/src/stty.rs +++ b/src/uu/stty/src/stty.rs @@ -630,42 +630,36 @@ fn print_terminal_size( // GNU linked against glibc 2.42 provides us baudrate 51 which panics cfgetospeed #[cfg(not(target_os = "linux"))] let speed = nix::sys::termios::cfgetospeed(termios); - #[cfg(all( - target_os = "linux", - not(target_arch = "powerpc"), - not(target_arch = "powerpc64") - ))] + #[cfg(target_os = "linux")] + #[cfg(all(not(target_arch = "powerpc"), not(target_arch = "powerpc64")))] ioctl_read_bad!(tcgets2, TCGETS2, termios2); - #[cfg(all( - target_os = "linux", - not(target_arch = "powerpc"), - not(target_arch = "powerpc64") - ))] + #[cfg(target_os = "linux")] + #[cfg(all(not(target_arch = "powerpc"), not(target_arch = "powerpc64")))] let speed = { let mut t2 = unsafe { std::mem::zeroed::() }; unsafe { tcgets2(opts.file.as_raw_fd(), &raw mut t2)? }; t2.c_ospeed }; - #[cfg(all( - target_os = "linux", - any(target_arch = "powerpc", target_arch = "powerpc64") - ))] + #[cfg(target_os = "linux")] + #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] let speed = nix::sys::termios::cfgetospeed(termios); let mut printer = WrappedPrinter::new(window_size); - // BSDs and Linux (non-PowerPC) use a u32 for the baud rate, so we can simply print it. + // BSDs and Linux (not ppc/big-endian ppc64) use a u32 for the baud rate, so we can simply + // print it. + #[cfg(any(target_os = "linux", bsd))] #[cfg(all( - any(target_os = "linux", bsd), not(target_arch = "powerpc"), - not(target_arch = "powerpc64") + not(all(target_arch = "powerpc64", target_endian = "big")) ))] printer.print(&translate!("stty-output-speed", "speed" => speed)); - // PowerPC uses BaudRate enum, need to convert to display format - #[cfg(all( - target_os = "linux", - any(target_arch = "powerpc", target_arch = "powerpc64") + // Big-endian Linux PowerPC uses BaudRate enum, need to convert to display format + #[cfg(target_os = "linux")] + #[cfg(any( + target_arch = "powerpc", + all(target_arch = "powerpc64", target_endian = "big") ))] { // On PowerPC, find the corresponding baud rate string for display