Commit d98143a5 authored by Niels Möller's avatar Niels Möller

Fix error check for tcgetattr and tcsetattr.

parent 8446ff74
2016-02-11 Niels Möller <nisse@lysator.liu.se>
* src/server_pty.c (pty_open_slave): Fix error check for tcgetattr
and tcsetattr.
2016-02-06 Niels Möller <nisse@lysator.liu.se>
* configure.ac: Update nettle configure test to require nettle-3
......
......@@ -189,7 +189,7 @@ pty_open_slave(struct pty_info *pty)
#endif /* defined(TIOCSCTTY) */
/* Set terminal modes */
if (!tcgetattr(fd, &ios) == -1)
if (tcgetattr(fd, &ios) < 0)
{
werror("pty_open_slave: Failed to get tty attributes: %e.\n", errno);
close(fd);
......@@ -203,14 +203,14 @@ pty_open_slave(struct pty_info *pty)
return -1;
}
if (!tcsetattr(fd, TCSADRAIN, &ios) == -1)
if (tcsetattr(fd, TCSADRAIN, &ios) < 0)
{
werror("pty_open_slave: Failed to set tty attributes: %e.\n", errno);
close(fd);
return -1;
}
if (ioctl(fd, TIOCSWINSZ, &pty->dims) == -1)
if (ioctl(fd, TIOCSWINSZ, &pty->dims) < 0)
{
werror("pty_open_slave: Failed to set tty window size: %e.\n", errno);
close(fd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment