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 <targos@protonmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
  • Loading branch information
bnoordhuis authored and devsnek committed Jul 2, 2019
1 parent 85496e9 commit 1095635
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 @@ -692,7 +692,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 1095635

Please sign in to comment.