diff options
Diffstat (limited to 'contrib/bind9/lib/dns/masterdump.c')
-rw-r--r-- | contrib/bind9/lib/dns/masterdump.c | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/contrib/bind9/lib/dns/masterdump.c b/contrib/bind9/lib/dns/masterdump.c index e2adf9b..c137b10 100644 --- a/contrib/bind9/lib/dns/masterdump.c +++ b/contrib/bind9/lib/dns/masterdump.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: masterdump.c,v 1.99.328.3 2011-06-21 20:15:47 each Exp $ */ +/* $Id: masterdump.c,v 1.99.258.7 2011-06-08 23:02:42 each Exp $ */ /*! \file */ @@ -871,9 +871,8 @@ dump_rdatasets_text(isc_mem_t *mctx, dns_name_t *name, for (i = 0; i < n; i++) { dns_rdataset_t *rds = sorted[i]; - if (ctx->style.flags & DNS_STYLEFLAG_TRUST) { + if (ctx->style.flags & DNS_STYLEFLAG_TRUST) fprintf(f, "; %s\n", dns_trust_totext(rds->trust)); - } if (((rds->attributes & DNS_RDATASETATTR_NEGATIVE) != 0) && (ctx->style.flags & DNS_STYLEFLAG_NCACHE) == 0) { /* Omit negative cache entries */ @@ -1047,6 +1046,8 @@ dump_rdatasets_raw(isc_mem_t *mctx, dns_name_t *name, buffer, f); } dns_rdataset_disassociate(&rdataset); + if (result != ISC_R_SUCCESS) + return (result); } if (result == ISC_R_NOMORE) @@ -1356,23 +1357,24 @@ dumptostreaminc(dns_dumpctx_t *dctx) { isc_buffer_region(&buffer, &r); isc_buffer_putuint32(&buffer, dns_masterformat_raw); isc_buffer_putuint32(&buffer, DNS_RAWFORMAT_VERSION); - if (sizeof(now32) != sizeof(dctx->now)) { - /* - * We assume isc_stdtime_t is a 32-bit integer, - * which should be the case on most cases. - * If it turns out to be uncommon, we'll need - * to bump the version number and revise the - * header format. - */ - isc_log_write(dns_lctx, - ISC_LOGCATEGORY_GENERAL, - DNS_LOGMODULE_MASTERDUMP, - ISC_LOG_INFO, - "dumping master file in raw " - "format: stdtime is not 32bits"); - now32 = 0; - } else - now32 = dctx->now; +#if !defined(STDTIME_ON_32BITS) || (STDTIME_ON_32BITS + 0) != 1 + /* + * We assume isc_stdtime_t is a 32-bit integer, + * which should be the case on most cases. + * If it turns out to be uncommon, we'll need + * to bump the version number and revise the + * header format. + */ + isc_log_write(dns_lctx, + ISC_LOGCATEGORY_GENERAL, + DNS_LOGMODULE_MASTERDUMP, + ISC_LOG_INFO, + "dumping master file in raw " + "format: stdtime is not 32bits"); + now32 = 0; +#else + now32 = dctx->now; +#endif isc_buffer_putuint32(&buffer, now32); INSIST(isc_buffer_usedlength(&buffer) <= sizeof(rawheader)); @@ -1742,6 +1744,14 @@ dns_master_dumpnode(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version, result = dns_master_dumpnodetostream(mctx, db, version, node, name, style, f); + if (result != ISC_R_SUCCESS) { + isc_log_write(dns_lctx, ISC_LOGCATEGORY_GENERAL, + DNS_LOGMODULE_MASTERDUMP, ISC_LOG_ERROR, + "dumping master file: %s: dump: %s", filename, + isc_result_totext(result)); + (void)isc_stdio_close(f); + return (ISC_R_UNEXPECTED); + } result = isc_stdio_close(f); if (result != ISC_R_SUCCESS) { |