mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
Refactor dns_adb_create() to return void
After isc_stats_create() change, the dns_adb_create() cannot fail, so refactor the function to return void and fix all its uses.
This commit is contained in:
committed by
Ondřej Surý
parent
5321c474ea
commit
045d8d9ed6
@@ -1960,7 +1960,7 @@ ISC_REFCOUNT_IMPL(dns_adb, destroy);
|
||||
* Public functions.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
void
|
||||
dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_loopmgr_t *loopmgr,
|
||||
dns_adb_t **newadb) {
|
||||
dns_adb_t *adb = NULL;
|
||||
@@ -2012,7 +2012,6 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_loopmgr_t *loopmgr,
|
||||
*/
|
||||
adb->magic = DNS_ADB_MAGIC;
|
||||
*newadb = adb;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -250,7 +250,7 @@ struct dns_adbaddrinfo {
|
||||
**** FUNCTIONS
|
||||
****/
|
||||
|
||||
isc_result_t
|
||||
void
|
||||
dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_loopmgr_t *loopmgr,
|
||||
dns_adb_t **newadb);
|
||||
/*%<
|
||||
@@ -270,11 +270,6 @@ dns_adb_create(isc_mem_t *mem, dns_view_t *view, isc_loopmgr_t *loopmgr,
|
||||
*\li 'loopmgr' be a valid loop manager.
|
||||
*
|
||||
*\li 'newadb' != NULL && '*newadb' == NULL.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
*\li #ISC_R_SUCCESS after happiness.
|
||||
*\li #ISC_R_NOMEMORY after resource allocation failure.
|
||||
*/
|
||||
|
||||
#if DNS_ADB_TRACE
|
||||
|
@@ -619,11 +619,8 @@ dns_view_createresolver(dns_view_t *view, isc_loopmgr_t *loopmgr,
|
||||
|
||||
isc_mem_create(&mctx);
|
||||
isc_mem_setname(mctx, "ADB");
|
||||
result = dns_adb_create(mctx, view, loopmgr, &view->adb);
|
||||
dns_adb_create(mctx, view, loopmgr, &view->adb);
|
||||
isc_mem_detach(&mctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto cleanup_resolver;
|
||||
}
|
||||
|
||||
result = dns_requestmgr_create(view->mctx, view->dispatchmgr,
|
||||
dispatchv4, dispatchv6,
|
||||
@@ -638,7 +635,6 @@ cleanup_adb:
|
||||
dns_adb_shutdown(view->adb);
|
||||
dns_adb_detach(&view->adb);
|
||||
|
||||
cleanup_resolver:
|
||||
dns_resolver_shutdown(view->resolver);
|
||||
dns_resolver_detach(&view->resolver);
|
||||
|
||||
|
Reference in New Issue
Block a user