diff --git a/src/node.cc b/src/node.cc index 8faac1212be2ad..c074ed0dfe1b47 100644 --- a/src/node.cc +++ b/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__