summaryrefslogtreecommitdiff
path: root/src/node_internals.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2019-05-24 16:11:19 +0200
committerRich Trott <rtrott@gmail.com>2019-06-12 20:47:03 -0700
commit5872705796d89d48bc4bf5f0b35678b0bd148ec2 (patch)
treefba35df4d7533287c7144828c8ffa281e9ab41e2 /src/node_internals.h
parent0f900405e52061136f7b5d69e6f2453309064c8a (diff)
downloadandroid-node-v8-5872705796d89d48bc4bf5f0b35678b0bd148ec2.tar.gz
android-node-v8-5872705796d89d48bc4bf5f0b35678b0bd148ec2.tar.bz2
android-node-v8-5872705796d89d48bc4bf5f0b35678b0bd148ec2.zip
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_internals.h')
-rw-r--r--src/node_internals.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/node_internals.h b/src/node_internals.h
index 9f6f5b19ad..691b954dc4 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -91,6 +91,7 @@ void PrintCaughtException(v8::Isolate* isolate,
const v8::TryCatch& try_catch);
void WaitForInspectorDisconnect(Environment* env);
+void ResetStdio(); // Safe to call more than once and from signal handlers.
#ifdef __POSIX__
void SignalExit(int signal, siginfo_t* info, void* ucontext);
#endif