system/cu: fix setting termios with parity

clear only the bits in c_cflag that will be set by cu
This commit is contained in:
Oleg 2021-07-19 11:40:28 +03:00 committed by Xiang Xiao
parent 7d457b4d0b
commit 51c778bc5c

View File

@ -146,14 +146,16 @@ static int set_termios(int fd, int rate, enum parity_mode parity,
tio = g_tio_dev;
tio.c_cflag &= ~(PARENB | PARODD | CRTSCTS);
switch (parity)
{
case PARITY_EVEN:
tio.c_cflag = PARENB;
tio.c_cflag |= PARENB;
break;
case PARITY_ODD:
tio.c_cflag = PARENB | PARODD;
tio.c_cflag |= PARENB | PARODD;
break;
case PARITY_NONE: