Skip to content

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

Merge request reports

Loading