From: Daniel Ribeiro Date: Mon, 10 Jan 2011 17:05:14 +0000 (-0200) Subject: serial.c: fix parity != none X-Git-Tag: libsigrok-0.1.0~458 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=ac4a2ea45a9320e87ec03cd820bf80c96eb65b21;p=libsigrok.git serial.c: fix parity != none The flag write was wrong --- diff --git a/hardware/common/serial.c b/hardware/common/serial.c index cebca29e..18b62d0c 100644 --- a/hardware/common/serial.c +++ b/hardware/common/serial.c @@ -228,16 +228,17 @@ int serial_set_params(int fd, int speed, int bits, int parity, int stopbits, return SIGROK_ERR; } - term.c_iflag &= ~(IGNPAR | PARODD | PARENB); + term.c_iflag &= ~IGNPAR; + term.c_cflag &= ~(PARODD | PARENB); switch (parity) { case 0: term.c_iflag |= IGNPAR; break; case 1: - term.c_iflag |= PARENB; + term.c_cflag |= PARENB; break; case 2: - term.c_iflag |= PARENB | PARODD; + term.c_cflag |= PARENB | PARODD; break; default: return SIGROK_ERR;