Skip to content

Commit

Permalink
src: assert that uv_async_init() succeeds
Browse files Browse the repository at this point in the history
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 committed May 22, 2017
1 parent f8c617d commit 06f62eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 06f62eb

Please sign in to comment.