fix for building with QNX

pull/615/head
JacobBarthelmeh 2023-11-08 00:10:36 -08:00
parent 903bc98c34
commit ab45a98d18
2 changed files with 43 additions and 11 deletions

View File

@ -162,12 +162,26 @@ static void modes_clear(void)
{ {
WOLFSSH_TERMIOS term = oldTerm; WOLFSSH_TERMIOS term = oldTerm;
term.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE | ECHOK term.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE
| ECHONL | ECHOPRT | NOFLSH | TOSTOP | FLUSHO | ECHOK | ECHONL | NOFLSH | TOSTOP);
| PENDIN | EXTPROC);
term.c_iflag &= ~(ISTRIP | INLCR | ICRNL | IGNCR | IXON | IXOFF /* check macros set for some BSD dependent and missing on
| IXANY | IGNBRK | INPCK | PARMRK); * 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 #ifdef IUCLC
term.c_iflag &= ~IUCLC; term.c_iflag &= ~IUCLC;
#endif #endif
@ -178,8 +192,10 @@ static void modes_clear(void)
term.c_oflag &= ~OLCUC; term.c_oflag &= ~OLCUC;
#endif #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); tcsetattr(STDIN_FILENO, TCSANOW, &term);
} }

View File

@ -556,8 +556,22 @@ int ClientSetEcho(int type)
newTerm.c_lflag &= ~ECHO; newTerm.c_lflag &= ~ECHO;
if (type == 2) { if (type == 2) {
newTerm.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE newTerm.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE
| ECHOK | ECHONL | ECHOPRT | NOFLSH | TOSTOP | FLUSHO | ECHOK | ECHONL | NOFLSH | TOSTOP);
| PENDIN | EXTPROC);
/* 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 newTerm.c_iflag &= ~(ISTRIP | INLCR | ICRNL | IGNCR | IXON
| IXOFF | IXANY | IGNBRK | INPCK | PARMRK); | IXOFF | IXANY | IGNBRK | INPCK | PARMRK);
@ -571,8 +585,10 @@ int ClientSetEcho(int type)
newTerm.c_oflag &= ~OLCUC; newTerm.c_oflag &= ~OLCUC;
#endif #endif
newTerm.c_cflag &= ~(CSTOPB | PARENB | PARODD | CLOCAL newTerm.c_cflag &= ~(CSTOPB | PARENB | PARODD | CLOCAL);
| CRTSCTS); #ifdef CRTSCTS
newTerm.c_cflag &= ~(CRTSCTS);
#endif
} }
else { else {
newTerm.c_lflag |= (ICANON | ECHONL); newTerm.c_lflag |= (ICANON | ECHONL);