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 <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
  • Loading branch information
cjihrig authored and jasnell committed May 23, 2017
1 parent f36c970 commit 1acd4d2
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 1acd4d2

Please sign in to comment.