diff --git a/man/tio.1.in b/man/tio.1.in index 4c107fe..f15c400 100644 --- a/man/tio.1.in +++ b/man/tio.1.in @@ -34,9 +34,11 @@ Set flow control (default: none). Set stop bits (default: 1). .TP -.BR \-p ", " "\-\-parity odd" | even | none | mark +.BR \-p ", " "\-\-parity odd" | even | none | mark | space Set parity (default: none). + +Note: With mark parity the parity bit is always 0. With space parity the parity bit is always 1. Not all platforms support mark and space parity. .TP .BR \-o ", " "\-\-output\-delay " \fI diff --git a/src/tty.c b/src/tty.c index 5c6c7af..3ed2ef2 100644 --- a/src/tty.c +++ b/src/tty.c @@ -625,10 +625,16 @@ void tty_configure(void) } else if ( strcmp("mark", option.parity) == 0) { - tio.c_cflag &= ~PARENB; + tio.c_cflag |= PARENB; tio.c_cflag |= PARODD; tio.c_cflag |= CMSPAR; } + else if ( strcmp("space", option.parity) == 0) + { + tio.c_cflag |= PARENB; + tio.c_cflag &= ~PARODD; + tio.c_cflag |= CMSPAR; + } else { error_printf("Invalid parity");