diff --git a/src/posix/termios.rs b/src/posix/termios.rs index ec8c9c2d..f47555aa 100644 --- a/src/posix/termios.rs +++ b/src/posix/termios.rs @@ -154,17 +154,29 @@ pub(crate) fn set_parity(termios: &mut Termios, parity: Parity) -> Result<()> { termios.c_cflag &= !(libc::PARENB | libc::PARODD); termios.c_iflag &= !libc::INPCK; termios.c_iflag |= libc::IGNPAR; + #[cfg(any(target_os = "linux", target_os = "android"))] + { + termios.c_iflag &= !libc::CMSPAR; + } } Parity::Odd => { termios.c_cflag |= libc::PARENB | libc::PARODD; termios.c_iflag |= libc::INPCK; termios.c_iflag &= !libc::IGNPAR; + #[cfg(any(target_os = "linux", target_os = "android"))] + { + termios.c_iflag &= !libc::CMSPAR; + } } Parity::Even => { termios.c_cflag &= !libc::PARODD; termios.c_cflag |= libc::PARENB; termios.c_iflag |= libc::INPCK; termios.c_iflag &= !libc::IGNPAR; + #[cfg(any(target_os = "linux", target_os = "android"))] + { + termios.c_iflag &= !libc::CMSPAR; + } } #[cfg(any(target_os = "linux", target_os = "android"))] Parity::Mark => {