src: restore stdio on program exit by bnoordhuis · Pull Request #24260 · nodejs/node · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 88 additions & 6 deletions src/node.cc
2 changes: 1 addition & 1 deletion src/node_errors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,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;
}
Expand Down
1 change: 1 addition & 0 deletions src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/node_main_instance.cc