From c4b2c6fabf4a0c83b68ac033d586f14601b30688 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Fri, 1 Nov 2019 11:50:05 +0100 Subject: [PATCH 1/2] sys: termios: Fix inverted logic for [cfg()] conditional for sparc64 The fix for #1149 has the logic for the [cfg()] conditional inverted so that the aliases for VMIN and VTIME are defined on targets that are not linux-sparc64. --- src/sys/termios.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sys/termios.rs b/src/sys/termios.rs index 80c73c9cdf..31e7291bc8 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -583,9 +583,9 @@ libc_enum! { } } -#[cfg(not(all(target_os = "linux", target_arch = "sparc64")))] +#[cfg(all(target_os = "linux", target_arch = "sparc64"))] pub const VMIN: SpecialCharacterIndices = SpecialCharacterIndices::VEOF; -#[cfg(not(all(target_os = "linux", target_arch = "sparc64")))] +#[cfg(all(target_os = "linux", target_arch = "sparc64"))] pub const VTIME: SpecialCharacterIndices = SpecialCharacterIndices::VEOL; pub use libc::NCCS; From c7c1bebd696974ee21141008196c7aad3fd97112 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Fri, 1 Nov 2019 14:16:34 +0100 Subject: [PATCH 2/2] sys: termios: Use associated constants for VMIN and VTIME on sparc64 --- src/sys/termios.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sys/termios.rs b/src/sys/termios.rs index 31e7291bc8..d08b2541a9 100644 --- a/src/sys/termios.rs +++ b/src/sys/termios.rs @@ -584,9 +584,10 @@ libc_enum! { } #[cfg(all(target_os = "linux", target_arch = "sparc64"))] -pub const VMIN: SpecialCharacterIndices = SpecialCharacterIndices::VEOF; -#[cfg(all(target_os = "linux", target_arch = "sparc64"))] -pub const VTIME: SpecialCharacterIndices = SpecialCharacterIndices::VEOL; +impl SpecialCharacterIndices { + pub const VMIN: SpecialCharacterIndices = SpecialCharacterIndices::VEOF; + pub const VTIME: SpecialCharacterIndices = SpecialCharacterIndices::VEOL; +} pub use libc::NCCS; #[cfg(any(target_os = "dragonfly",