Skip to content
Permalink
Browse files

src: don't abort on EIO when restoring tty

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 targos committed Jul 1, 2019
1 parent 5f9ee9f commit 035b613f80000a71069440ec13b0dabae8eaba33
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/node.cc
@@ -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__

0 comments on commit 035b613

Please sign in to comment.
You can’t perform that action at this time.