From 57bca94cb1341a6b43f1e9648299964ebee427eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 22 Nov 2022 13:50:54 +0100 Subject: [PATCH] src: avoid unused variables and functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/45542 Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: Richard Lau Reviewed-By: Darshan Sen Reviewed-By: Yagiz Nizipli --- src/inspector_agent.cc | 2 ++ src/node_binding.cc | 2 +- src/node_credentials.cc | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index 3fae123ed59325..decd9f748a2775 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -52,7 +52,9 @@ using v8_inspector::StringView; using v8_inspector::V8Inspector; using v8_inspector::V8InspectorClient; +#ifdef __POSIX__ static uv_sem_t start_io_thread_semaphore; +#endif // __POSIX__ static uv_async_t start_io_thread_async; // This is just an additional check to make sure start_io_thread_async // is not accidentally re-used or used when uninitialized. diff --git a/src/node_binding.cc b/src/node_binding.cc index fa67a45386e159..d3b0678f9c79c9 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc @@ -222,7 +222,7 @@ static bool libc_may_be_musl() { has_cached_retval = true; return retval; } -#else // __linux__ +#elif defined(__POSIX__) static bool libc_may_be_musl() { return false; } #endif // __linux__ diff --git a/src/node_credentials.cc b/src/node_credentials.cc index 115c2fc877d5cc..9bf9b2442fa99f 100644 --- a/src/node_credentials.cc +++ b/src/node_credentials.cc @@ -456,12 +456,12 @@ static void Initialize(Local target, Local unused, Local context, void* priv) { - Environment* env = Environment::GetCurrent(context); - Isolate* isolate = env->isolate(); - SetMethod(context, target, "safeGetenv", SafeGetenv); #ifdef NODE_IMPLEMENTS_POSIX_CREDENTIALS + Environment* env = Environment::GetCurrent(context); + Isolate* isolate = env->isolate(); + READONLY_TRUE_PROPERTY(target, "implementsPosixCredentials"); SetMethodNoSideEffect(context, target, "getuid", GetUid); SetMethodNoSideEffect(context, target, "geteuid", GetEUid);