Skip to content
Permalink
Browse files

src: assert that uv_async_init() succeeds

This commit fixes two coverity warnings for unchecked
return values.

Refs: #13050
PR-URL: #13116
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
  • Loading branch information...
cjihrig authored and jasnell committed May 19, 2017
1 parent f36c970 commit 1acd4d2cc4737aa0b3f5190da97c0ae1ffe9d5b4
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/cares_wrap.cc
@@ -534,7 +534,9 @@ class QueryWrap : public AsyncWrap {
data->len = answer_len;

uv_async_t* async_handle = &data->async_handle;
uv_async_init(wrap->env()->event_loop(), async_handle, CaresAsyncCb);
CHECK_EQ(0, uv_async_init(wrap->env()->event_loop(),
async_handle,
CaresAsyncCb));

wrap->env()->set_cares_query_last_ok(status != ARES_ECONNREFUSED);
async_handle->data = data;
@@ -558,7 +560,9 @@ class QueryWrap : public AsyncWrap {
data->is_host = true;

uv_async_t* async_handle = &data->async_handle;
uv_async_init(wrap->env()->event_loop(), async_handle, CaresAsyncCb);
CHECK_EQ(0, uv_async_init(wrap->env()->event_loop(),
async_handle,
CaresAsyncCb));

wrap->env()->set_cares_query_last_ok(status != ARES_ECONNREFUSED);
async_handle->data = data;

0 comments on commit 1acd4d2

Please sign in to comment.
You can’t perform that action at this time.