src: assert that uv_async_init() succeeds

This commit fixes two coverity warnings for unchecked
return values.

Refs: https://github.com/nodejs/node/pull/13050
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
cjihrig authored and Myles Borins committed 2017-07-11 17:43:49 +01:00
1 parent 18cbee236d
commit f92e065d12
1 file changed
+6 -2
+6 -2
View File
@@ -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);
@@ -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);