Commit fc3ab47d authored by Brian Wellington's avatar Brian Wellington
Browse files

remove calls to printf() in error handling.

parent 0bd78514
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: nxt.c,v 1.24 2000/10/25 04:26:40 marka Exp $ */ /* $Id: nxt.c,v 1.25 2000/10/28 01:25:14 bwelling Exp $ */
#include <config.h> #include <config.h>
...@@ -31,13 +31,10 @@ ...@@ -31,13 +31,10 @@
#include <dns/rdatastruct.h> #include <dns/rdatastruct.h>
#include <dns/result.h> #include <dns/result.h>
#define check_result(op, msg) \ #define RETERR(x) do { \
do { result = (op); \ result = (x); \
if (result != ISC_R_SUCCESS) { \ if (result != ISC_R_SUCCESS) \
fprintf(stderr, "%s: %s\n", msg, \ goto failure; \
isc_result_totext(result)); \
goto failure; \
} \
} while (0) } while (0)
static void static void
...@@ -146,9 +143,7 @@ dns_nxt_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node, ...@@ -146,9 +143,7 @@ dns_nxt_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
dns_rdataset_init(&rdataset); dns_rdataset_init(&rdataset);
dns_rdata_init(&rdata); dns_rdata_init(&rdata);
result = dns_nxt_buildrdata(db, version, node, RETERR(dns_nxt_buildrdata(db, version, node, target, data, &rdata));
target, data, &rdata);
check_result(result, "dns_nxt_buildrdata");
rdatalist.rdclass = dns_db_class(db); rdatalist.rdclass = dns_db_class(db);
rdatalist.type = dns_rdatatype_nxt; rdatalist.type = dns_rdatatype_nxt;
...@@ -156,13 +151,12 @@ dns_nxt_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node, ...@@ -156,13 +151,12 @@ dns_nxt_build(dns_db_t *db, dns_dbversion_t *version, dns_dbnode_t *node,
rdatalist.ttl = ttl; rdatalist.ttl = ttl;
ISC_LIST_INIT(rdatalist.rdata); ISC_LIST_INIT(rdatalist.rdata);
ISC_LIST_APPEND(rdatalist.rdata, &rdata, link); ISC_LIST_APPEND(rdatalist.rdata, &rdata, link);
result = dns_rdatalist_tordataset(&rdatalist, &rdataset); RETERR(dns_rdatalist_tordataset(&rdatalist, &rdataset));
check_result(result, "dns_rdatalist_tordataset");
result = dns_db_addrdataset(db, node, version, 0, &rdataset, result = dns_db_addrdataset(db, node, version, 0, &rdataset,
0, NULL); 0, NULL);
if (result == DNS_R_UNCHANGED) if (result == DNS_R_UNCHANGED)
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
check_result(result, "dns_db_addrdataset"); RETERR(result);
failure: failure:
if (dns_rdataset_isassociated(&rdataset)) if (dns_rdataset_isassociated(&rdataset))
dns_rdataset_disassociate(&rdataset); dns_rdataset_disassociate(&rdataset);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment