Skip to content

Commit 1095635

Browse files
bnoordhuisdevsnek
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 85496e9 commit 1095635

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,10 @@ void ResetStdio() {
692692
do
693693
err = tcsetattr(fd, TCSANOW, &s.termios);
694694
while (err == -1 && errno == EINTR); // NOLINT
695-
CHECK_NE(err, -1);
695+
// EIO has been observed to be returned by the Linux kernel under some
696+
// circumstances. Reading through drivers/tty/tty_io*.c, it seems to
697+
// indicate the tty went away. Of course none of this is documented.
698+
CHECK_IMPLIES(err == -1, errno == EIO);
696699
}
697700
}
698701
#endif // __POSIX__

0 commit comments

Comments
 (0)