Skip to content

Commit

Permalink
src: don't abort on EIO when restoring tty
Browse files Browse the repository at this point in the history
EIO has been observed to be returned by the Linux kernel under some
circumstances. Reading through drivers/tty/tty_io*.c, it seems to
indicate the tty went away. Of course none of this is documented.

Fixes: #28479

PR-URL: #28490
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
  • Loading branch information
bnoordhuis authored and targos committed Jul 2, 2019
1 parent 5f9ee9f commit 035b613
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,10 @@ void ResetStdio() {
do
err = tcsetattr(fd, TCSANOW, &s.termios);
while (err == -1 && errno == EINTR); // NOLINT
CHECK_NE(err, -1);
// EIO has been observed to be returned by the Linux kernel under some
// circumstances. Reading through drivers/tty/tty_io*.c, it seems to
// indicate the tty went away. Of course none of this is documented.
CHECK_IMPLIES(err == -1, errno == EIO);
}
}
#endif // __POSIX__
Expand Down

0 comments on commit 035b613

Please sign in to comment.