/* -------------- Set parity ------------------ */
if (t->c_cflag & PARENB)
- state.Parity = (t->c_cflag & PARODD) ? ODDPARITY : EVENPARITY;
+ {
+ if(t->c_cflag & CMSPAR)
+ state.Parity = (t->c_cflag & PARODD) ? MARKPARITY : SPACEPARITY;
+ else
+ state.Parity = (t->c_cflag & PARODD) ? ODDPARITY : EVENPARITY;
+ }
else
state.Parity = NOPARITY;
t->c_cflag |= (PARENB | PARODD);
if (state.Parity == EVENPARITY)
t->c_cflag |= PARENB;
+ if (state.Parity == MARKPARITY)
+ t->c_cflag |= (PARENB | PARODD | CMSPAR);
+ if (state.Parity == SPACEPARITY)
+ t->c_cflag |= (PARENB | CMSPAR);
/* -------------- Parity errors ------------------ */