Skip to content

Commit 830f93d

Browse files
mhdawsondanielleadams
authored andcommitted
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 <[email protected]> PR-URL: #42176 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 6545094 commit 830f93d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/env.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -545,21 +545,21 @@ void Environment::InitializeLibuv() {
545545
CHECK_EQ(0, uv_timer_init(event_loop(), timer_handle()));
546546
uv_unref(reinterpret_cast<uv_handle_t*>(timer_handle()));
547547

548-
uv_check_init(event_loop(), immediate_check_handle());
548+
CHECK_EQ(0, uv_check_init(event_loop(), immediate_check_handle()));
549549
uv_unref(reinterpret_cast<uv_handle_t*>(immediate_check_handle()));
550550

551-
uv_idle_init(event_loop(), immediate_idle_handle());
551+
CHECK_EQ(0, uv_idle_init(event_loop(), immediate_idle_handle()));
552552

553-
uv_check_start(immediate_check_handle(), CheckImmediate);
553+
CHECK_EQ(0, uv_check_start(immediate_check_handle(), CheckImmediate));
554554

555555
// Inform V8's CPU profiler when we're idle. The profiler is sampling-based
556556
// but not all samples are created equal; mark the wall clock time spent in
557557
// epoll_wait() and friends so profiling tools can filter it out. The samples
558558
// still end up in v8.log but with state=IDLE rather than state=EXTERNAL.
559-
uv_prepare_init(event_loop(), &idle_prepare_handle_);
560-
uv_check_init(event_loop(), &idle_check_handle_);
559+
CHECK_EQ(0, uv_prepare_init(event_loop(), &idle_prepare_handle_));
560+
CHECK_EQ(0, uv_check_init(event_loop(), &idle_check_handle_));
561561

562-
uv_async_init(
562+
CHECK_EQ(0, uv_async_init(
563563
event_loop(),
564564
&task_queues_async_,
565565
[](uv_async_t* async) {
@@ -568,7 +568,7 @@ void Environment::InitializeLibuv() {
568568
HandleScope handle_scope(env->isolate());
569569
Context::Scope context_scope(env->context());
570570
env->RunAndClearNativeImmediates();
571-
});
571+
}));
572572
uv_unref(reinterpret_cast<uv_handle_t*>(&idle_prepare_handle_));
573573
uv_unref(reinterpret_cast<uv_handle_t*>(&idle_check_handle_));
574574
uv_unref(reinterpret_cast<uv_handle_t*>(&task_queues_async_));

0 commit comments

Comments
 (0)