From becbcc798144ee54aad554672a21b2d3402108b7 Mon Sep 17 00:00:00 2001 From: Ali Ijaz Sheikh Date: Thu, 25 Aug 2016 14:14:47 -0700 Subject: [PATCH] src: avoid duplicate AtExit functions node.cc had two functions with the name AtExit with entirely different purposes: * node::AtExit(): file static; used to register the atexit(3) handler for the Node process. * node::AtExit(void (*)(void*), void*): publicly exported symbol that addons can use to request callbacks upon exit. For code readability it is better to avoid the unintentional overload. PR-URL: https://github.com/nodejs/node/pull/8273 Reviewed-By: addaleax - Anna Henningsen Reviewed-By: jasnell - James M Snell Reviewed-By: cjihrig - Colin Ihrig Reviewed-By: bnoordhuis - Ben Noordhuis --- src/node.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.cc b/src/node.cc index 5cab485bbd7c40..9dc66f907f4c3f 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3326,7 +3326,7 @@ void SetupProcessObject(Environment* env, #undef READONLY_PROPERTY -static void AtExit() { +static void AtProcessExit() { uv_tty_reset_mode(); } @@ -3363,7 +3363,7 @@ void LoadEnvironment(Environment* env) { env->isolate()->SetFatalErrorHandler(node::OnFatalError); env->isolate()->AddMessageListener(OnMessage); - atexit(AtExit); + atexit(AtProcessExit); TryCatch try_catch(env->isolate());