diff --git a/apps/wolfssh/wolfssh.c b/apps/wolfssh/wolfssh.c index 9448e3f34..751c5ec01 100644 --- a/apps/wolfssh/wolfssh.c +++ b/apps/wolfssh/wolfssh.c @@ -162,12 +162,26 @@ static void modes_clear(void) { WOLFSSH_TERMIOS term = oldTerm; - term.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE | ECHOK - | ECHONL | ECHOPRT | NOFLSH | TOSTOP | FLUSHO - | PENDIN | EXTPROC); + term.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE + | ECHOK | ECHONL | NOFLSH | TOSTOP); - term.c_iflag &= ~(ISTRIP | INLCR | ICRNL | IGNCR | IXON | IXOFF - | IXANY | IGNBRK | INPCK | PARMRK); + /* check macros set for some BSD dependent and missing on + * QNX flags */ +#ifdef ECHOPRT + term.c_lflag &= ~(ECHOPRT); +#endif +#ifdef FLUSHO + term.c_lflag &= ~(FLUSHO); +#endif +#ifdef PENDIN + term.c_lflag &= ~(PENDIN); +#endif +#ifdef EXTPROC + term.c_lflag &= ~(EXTPROC); +#endif + + term.c_iflag &= ~(ISTRIP | INLCR | ICRNL | IGNCR | IXON + | IXOFF | IXANY | IGNBRK | INPCK | PARMRK); #ifdef IUCLC term.c_iflag &= ~IUCLC; #endif @@ -178,8 +192,10 @@ static void modes_clear(void) term.c_oflag &= ~OLCUC; #endif - term.c_cflag &= ~(CSTOPB | PARENB | PARODD | CLOCAL | CRTSCTS); - + term.c_cflag &= ~(CSTOPB | PARENB | PARODD | CLOCAL); +#ifdef CRTSCTS + term.c_cflag &= ~(CRTSCTS); +#endif tcsetattr(STDIN_FILENO, TCSANOW, &term); } diff --git a/examples/client/common.c b/examples/client/common.c index 3ae6a7316..da2da1ea9 100644 --- a/examples/client/common.c +++ b/examples/client/common.c @@ -556,8 +556,22 @@ int ClientSetEcho(int type) newTerm.c_lflag &= ~ECHO; if (type == 2) { newTerm.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE - | ECHOK | ECHONL | ECHOPRT | NOFLSH | TOSTOP | FLUSHO - | PENDIN | EXTPROC); + | ECHOK | ECHONL | NOFLSH | TOSTOP); + + /* check macros set for some BSD dependent and not missing on + * QNX flags */ + #ifdef ECHOPRT + newTerm.c_lflag &= ~(ECHOPRT); + #endif + #ifdef FLUSHO + newTerm.c_lflag &= ~(FLUSHO); + #endif + #ifdef PENDIN + newTerm.c_lflag &= ~(PENDIN); + #endif + #ifdef EXTPROC + newTerm.c_lflag &= ~(EXTPROC); + #endif newTerm.c_iflag &= ~(ISTRIP | INLCR | ICRNL | IGNCR | IXON | IXOFF | IXANY | IGNBRK | INPCK | PARMRK); @@ -571,8 +585,10 @@ int ClientSetEcho(int type) newTerm.c_oflag &= ~OLCUC; #endif - newTerm.c_cflag &= ~(CSTOPB | PARENB | PARODD | CLOCAL - | CRTSCTS); + newTerm.c_cflag &= ~(CSTOPB | PARENB | PARODD | CLOCAL); + #ifdef CRTSCTS + newTerm.c_cflag &= ~(CRTSCTS); + #endif } else { newTerm.c_lflag |= (ICANON | ECHONL);