Fix incorrect check for error of tcsetattr()

Prior to this commit, the code was incorrectly checking whether
tcsetattr() succeeded or not: The condition (err == -1 && err == EINTR)
is always false.
This commit is contained in:
Mingjie Shen 2024-03-27 19:42:56 -04:00
parent d8cc0b0465
commit be0978f229

View File

@ -715,7 +715,7 @@ static int set_disp_mode(int fd, int option) {
else
term.c_lflag &= ~ECHOFLAGS;
err = tcsetattr(fd, TCSAFLUSH, &term);
if (err == -1 && err == EINTR) {
if (err == -1) {
perror("Cannot set the attribution of the terminal");
return 1;
}