diff options
| author | Xin LI <delphij@FreeBSD.org> | 2015-04-08 17:52:54 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2015-04-08 17:52:54 +0000 |
| commit | 7ba7a5de74780dee4ec54bace1ec36427be1d8b8 (patch) | |
| tree | a5a1890b0b884a1d303e90c4130c3b731772abd5 /lib/dns/rootns.c | |
| parent | a2bc50f814b6966b412ba90221460066a8b31951 (diff) | |
Vendor import of BIND 9.9.7vendor/bind9/9.9.7
Diffstat (limited to 'lib/dns/rootns.c')
| -rw-r--r-- | lib/dns/rootns.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/dns/rootns.c b/lib/dns/rootns.c index a3d9bd8d6084..21c532c39696 100644 --- a/lib/dns/rootns.c +++ b/lib/dns/rootns.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2008, 2010, 2012-2014 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008, 2010, 2012-2015 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2002 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -211,7 +211,7 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, result = dns_db_create(mctx, "rbt", dns_rootname, dns_dbtype_zone, rdclass, 0, NULL, &db); if (result != ISC_R_SUCCESS) - return (result); + goto failure; dns_rdatacallbacks_init(&callbacks); @@ -222,7 +222,7 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, result = dns_db_beginload(db, &callbacks.add, &callbacks.add_private); if (result != ISC_R_SUCCESS) - return (result); + goto failure; if (filename != NULL) { /* * Load the hints from the specified filename. @@ -245,7 +245,7 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, if (result == ISC_R_SUCCESS || result == DNS_R_SEENINCLUDE) result = eresult; if (result != ISC_R_SUCCESS && result != DNS_R_SEENINCLUDE) - goto db_detach; + goto failure; if (check_hints(db) != ISC_R_SUCCESS) isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS, ISC_LOG_WARNING, @@ -254,8 +254,14 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, *target = db; return (ISC_R_SUCCESS); - db_detach: - dns_db_detach(&db); + failure: + isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_HINTS, + ISC_LOG_ERROR, "could not configure root hints from " + "'%s': %s", (filename != NULL) ? filename : "<BUILT-IN>", + isc_result_totext(result)); + + if (db != NULL) + dns_db_detach(&db); return (result); } |
