diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2019-07-01 08:34:25 +0200 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2019-07-01 19:48:28 -0500 |
commit | 1095635a8aaf8658670a0610fea5dd775bac36d1 (patch) | |
tree | b2db41065c841f6b507ada7352c9cdb100858861 /src | |
parent | 85496e94d3b7053f0954b15973c55bb1e8e1f11b (diff) | |
download | android-node-v8-1095635a8aaf8658670a0610fea5dd775bac36d1.tar.gz android-node-v8-1095635a8aaf8658670a0610fea5dd775bac36d1.tar.bz2 android-node-v8-1095635a8aaf8658670a0610fea5dd775bac36d1.zip |
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: https://github.com/nodejs/node/issues/28479
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'src')
-rw-r--r-- | src/node.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/node.cc b/src/node.cc index 9b4328d2ec..9fdef1a259 100644 --- a/src/node.cc +++ b/src/node.cc @@ -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__ |