[PATCH] ntdll: correct space/mark parity

Julien D'ascenzio Julien.Dascenzio at paratronic.fr
Thu Jan 31 07:28:57 CST 2019


When CMSPAR is define, the space and mark parity is reversed: The flag PARODD isn't set correctly
---
 dlls/ntdll/serial.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c
index 29e9fafbca..b3404d4534 100644
--- a/dlls/ntdll/serial.c
+++ b/dlls/ntdll/serial.c
@@ -280,8 +280,8 @@ static NTSTATUS get_line_control(int fd, SERIAL_LINE_CONTROL* slc)
     case PARENB:                slc->Parity = EVENPARITY;       break;
     case PARENB|PARODD:         slc->Parity = ODDPARITY;        break;
 #ifdef CMSPAR
-    case PARENB|CMSPAR:         slc->Parity = MARKPARITY;       break;
-    case PARENB|PARODD|CMSPAR:  slc->Parity = SPACEPARITY;      break;
+    case PARENB|PARODD|CMSPAR:         slc->Parity = MARKPARITY;       break;
+    case PARENB|CMSPAR:  slc->Parity = SPACEPARITY;      break;
 #endif
     }
     switch (port.c_cflag & CSIZE)
@@ -676,8 +676,8 @@ static NTSTATUS set_line_control(int fd, const SERIAL_LINE_CONTROL* slc)
     case EVENPARITY:    port.c_cflag |= PARENB;                         break;
 #ifdef CMSPAR
         /* Linux defines mark/space (stick) parity */
-    case MARKPARITY:    port.c_cflag |= PARENB | CMSPAR;                break;
-    case SPACEPARITY:   port.c_cflag |= PARENB | PARODD |  CMSPAR;      break;
+    case MARKPARITY:    port.c_cflag |= PARENB | PARODD | CMSPAR;                break;
+    case SPACEPARITY:   port.c_cflag |= PARENB | CMSPAR;      break;
 #else
         /* try the POSIX way */
     case MARKPARITY:
-- 
2.11.0



More information about the wine-devel mailing list