Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2019-05-24 17:11:19 +0300
committerRich Trott <rtrott@gmail.com>2019-06-13 06:47:03 +0300
commit5872705796d89d48bc4bf5f0b35678b0bd148ec2 (patch)
treefba35df4d7533287c7144828c8ffa281e9ab41e2 /src/node_errors.cc
parent0f900405e52061136f7b5d69e6f2453309064c8a (diff)
src: restore stdio on program exit
Record the state of the stdio file descriptors on start-up and restore them to that state on exit. This should prevent issues where node.js sometimes leaves stdio in raw or non-blocking mode. This is a reworked version of commit c2c9c0c3d3 from May 2018 that was reverted in commit 14dc17df38 from June 2018. The revert was a little light on details but I infer that the problem was caused by a missing call to `uv_tty_reset_mode()`. Apropos the NOLINT comments: cpplint doesn't understand do/while statements, it thinks they're while statements without a body. Fixes: https://github.com/nodejs/node/issues/14752 Fixes: https://github.com/nodejs/node/issues/21020 Original-PR-URL: https://github.com/nodejs/node/pull/20592 PR-URL: https://github.com/nodejs/node/pull/24260 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r--src/node_errors.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc
index baf08b30458..50469b09a8a 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -230,7 +230,7 @@ void AppendExceptionLine(Environment* env,
Mutex::ScopedLock lock(per_process::tty_mutex);
env->set_printed_error(true);
- uv_tty_reset_mode();
+ ResetStdio();
PrintErrorString("\n%s", source.c_str());
return;
}