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: nodejs#28479
  • Loading branch information
bnoordhuis committed Jul 1, 2019
1 parent 20d099a commit 1ba286c
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 1ba286c

Please sign in to comment.