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 authored and MylesBorins committed Jul 11, 2017
1 parent 18cbee2 commit f92e065
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 @@ -449,7 +449,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));

async_handle->data = data;
uv_async_send(async_handle);
Expand All @@ -472,7 +474,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));

async_handle->data = data;
uv_async_send(async_handle);
Expand Down

0 comments on commit f92e065

Please sign in to comment.