Skip to content

Commit 035b613

Browse files
bnoordhuistargos
authored andcommitted
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 <[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]>
1 parent 5f9ee9f commit 035b613

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node.cc

+4-1
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,10 @@ void ResetStdio() {
644644
do
645645
err = tcsetattr(fd, TCSANOW, &s.termios);
646646
while (err == -1 && errno == EINTR); // NOLINT
647-
CHECK_NE(err, -1);
647+
// EIO has been observed to be returned by the Linux kernel under some
648+
// circumstances. Reading through drivers/tty/tty_io*.c, it seems to
649+
// indicate the tty went away. Of course none of this is documented.
650+
CHECK_IMPLIES(err == -1, errno == EIO);
648651
}
649652
}
650653
#endif // __POSIX__

0 commit comments

Comments
 (0)