mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-03 14:00:47 -05:00
Add UV_RUNTIME_CHECK() macro to print uv_strerror()
When libuv functions fail, they return correct return value that could
be useful for more detailed debugging. Currently, we usually just check
whether the return value is 0 and invoke assertion error if it doesn't
throwing away the details why the call has failed. Unfortunately, this
often happen on more exotic platforms.
Add a UV_RUNTIME_CHECK() macro that can be used to print more detailed
error message (via uv_strerror() before ending the execution of the
program abruptly with the assertion.
(cherry picked from commit 62e15bb06d)
This commit is contained in:
parent
33b5f979ba
commit
b8be8048b5
1 changed files with 6 additions and 0 deletions
|
|
@ -2078,3 +2078,9 @@ void
|
|||
isc__nm_accept_connection_log(isc_result_t result, bool can_log_quota);
|
||||
|
||||
#define STREAM_CLIENTS_PER_CONN 23
|
||||
|
||||
#define UV_RUNTIME_CHECK(func, ret) \
|
||||
if (ret != 0) { \
|
||||
isc_error_fatal(__FILE__, __LINE__, "%s failed: %s\n", #func, \
|
||||
uv_strerror(ret)); \
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue