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:
parent
7d457b4d0b
commit
51c778bc5c
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user