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 = g_tio_dev;
|
||||||
|
|
||||||
|
tio.c_cflag &= ~(PARENB | PARODD | CRTSCTS);
|
||||||
|
|
||||||
switch (parity)
|
switch (parity)
|
||||||
{
|
{
|
||||||
case PARITY_EVEN:
|
case PARITY_EVEN:
|
||||||
tio.c_cflag = PARENB;
|
tio.c_cflag |= PARENB;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PARITY_ODD:
|
case PARITY_ODD:
|
||||||
tio.c_cflag = PARENB | PARODD;
|
tio.c_cflag |= PARENB | PARODD;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PARITY_NONE:
|
case PARITY_NONE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user