From d85ea55990242557beaf076c84da2e58cd520989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Czapli=C5=84ski?= Date: Tue, 9 May 2017 14:32:37 +0200 Subject: [PATCH] serial_posix: fix even parity Previously, when even parity was requested, PARODD was erroneously retained, and thus could actually result in odd parity being set (retained from what was set by tcgetattr) --- serial_posix.go | 1 + 1 file changed, 1 insertion(+) diff --git a/serial_posix.go b/serial_posix.go index 3e8bc7c..607238a 100644 --- a/serial_posix.go +++ b/serial_posix.go @@ -113,6 +113,7 @@ func openPort(name string, baud int, databits byte, parity Parity, stopbits Stop st.c_cflag |= C.PARODD case ParityEven: st.c_cflag |= C.PARENB + st.c_cflag &= ^C.tcflag_t(C.PARODD) default: return nil, ErrBadParity }