1
1

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.
Этот коммит содержится в:
Peter Stuge 2012-02-29 22:27:18 +01:00
родитель e07342443f
Коммит aa8f2cbf33

Просмотреть файл

@ -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;