From c6db0f0f63864125de0379f565589f7a13b075b2 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 1 Mar 2022 16:27:29 -0500 Subject: [PATCH] src: fix unchecked return warning from coverity Fix unchecked return warning from coverity in src/env.cc. Added check in same manner as other places where uv_async_init is called. Signed-off-by: Michael Dawson PR-URL: https://github.com/nodejs/node/pull/42176 Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen Reviewed-By: Anna Henningsen --- src/env.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/env.cc b/src/env.cc index f2cb5243944c9d..3c07e9342fd338 100644 --- a/src/env.cc +++ b/src/env.cc @@ -545,21 +545,21 @@ void Environment::InitializeLibuv() { CHECK_EQ(0, uv_timer_init(event_loop(), timer_handle())); uv_unref(reinterpret_cast(timer_handle())); - uv_check_init(event_loop(), immediate_check_handle()); + CHECK_EQ(0, uv_check_init(event_loop(), immediate_check_handle())); uv_unref(reinterpret_cast(immediate_check_handle())); - uv_idle_init(event_loop(), immediate_idle_handle()); + CHECK_EQ(0, uv_idle_init(event_loop(), immediate_idle_handle())); - uv_check_start(immediate_check_handle(), CheckImmediate); + CHECK_EQ(0, uv_check_start(immediate_check_handle(), CheckImmediate)); // Inform V8's CPU profiler when we're idle. The profiler is sampling-based // but not all samples are created equal; mark the wall clock time spent in // epoll_wait() and friends so profiling tools can filter it out. The samples // still end up in v8.log but with state=IDLE rather than state=EXTERNAL. - uv_prepare_init(event_loop(), &idle_prepare_handle_); - uv_check_init(event_loop(), &idle_check_handle_); + CHECK_EQ(0, uv_prepare_init(event_loop(), &idle_prepare_handle_)); + CHECK_EQ(0, uv_check_init(event_loop(), &idle_check_handle_)); - uv_async_init( + CHECK_EQ(0, uv_async_init( event_loop(), &task_queues_async_, [](uv_async_t* async) { @@ -568,7 +568,7 @@ void Environment::InitializeLibuv() { HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); env->RunAndClearNativeImmediates(); - }); + })); uv_unref(reinterpret_cast(&idle_prepare_handle_)); uv_unref(reinterpret_cast(&idle_check_handle_)); uv_unref(reinterpret_cast(&task_queues_async_));