mirror of
https://github.com/libssh2/libssh2.git
synced 2025-07-29 13:01:14 +03:00
example/x11: Set raw terminal mode manually instead of with cfmakeraw()
OpenSolaris has no cfmakeraw() so to make the example more portable we simply do the equivalent operations on struct termios ourselves. Thanks to Tom Weber for reporting this problem, and finding a solution.
This commit is contained in:
@ -79,7 +79,12 @@ static int _raw_mode(void)
|
||||
rc = tcgetattr(fileno(stdin), &tio);
|
||||
if (rc != -1) {
|
||||
_saved_tio = tio;
|
||||
cfmakeraw(&tio);
|
||||
/* do the equivalent of cfmakeraw() manually, to build on Solaris */
|
||||
tio.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
|
||||
tio.c_oflag &= ~OPOST;
|
||||
tio.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
|
||||
tio.c_cflag &= ~(CSIZE|PARENB);
|
||||
tio.c_cflag |= CS8;
|
||||
rc = tcsetattr(fileno(stdin), TCSADRAIN, &tio);
|
||||
}
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user