Commit 58727057 authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Rich Trott
Browse files

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 c2c9c0c3 from May 2018 that was
reverted in commit 14dc17df 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: default avatarColin Ihrig <cjihrig@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarRefael Ackermann (רפאל פלחי) <refack@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent 0f900405
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment