(char*) isc_buffer_base(&key_txtbuffer));
CHECK(isc_stdio_flush(fp));
- CHECK(isc_stdio_close(fp));
+ result = isc_stdio_close(fp);
+ fp = NULL;
+ if (result != ISC_R_SUCCESS)
+ goto cleanup;
dst_key_free(&key);
cfg_printx(zconfig, CFG_PRINTER_ONELINE, dumpzone, fp);
CHECK(isc_stdio_write(";\n", 2, 1, fp, NULL));
CHECK(isc_stdio_flush(fp));
- CHECK(isc_stdio_close(fp));
+ result = isc_stdio_close(fp);
fp = NULL;
cleanup:
cfg_printx(config, CFG_PRINTER_ONELINE, dumpzone, fp);
CHECK(isc_stdio_flush(fp));
- CHECK(isc_stdio_close(fp));
+ result = isc_stdio_close(fp);
fp = NULL;
+ if (result != ISC_R_SUCCESS)
+ goto cleanup;
CHECK(isc_file_rename(tmp, view->new_zone_file));
return (result);
cleanup:
if (fp != NULL)
- (void) isc_stdio_close(fp);
- isc_file_remove(tmp);
+ (void)isc_stdio_close(fp);
+ (void)isc_file_remove(tmp);
return (result);
}
goto cleanup;
}
- isc_stdio_close(fp);
+ (void)isc_stdio_close(fp);
fp = NULL;
#else /* HAVE_LMDB */
/* Make sure we can open the NZD database */
#ifndef HAVE_LMDB
if (fp != NULL)
- (void) isc_stdio_close(fp);
+ (void)isc_stdio_close(fp);
#else /* HAVE_LMDB */
if (txn != NULL)
(void) nzd_close(&txn, ISC_FALSE);
TCHECK(putstr(text, isc_result_totext(result)));
goto cleanup;
}
- isc_stdio_close(fp);
+ (void)isc_stdio_close(fp);
fp = NULL;
#else /* HAVE_LMDB */
/* Make sure we can open the NZD database */
#ifndef HAVE_LMDB
if (fp != NULL)
- (void) isc_stdio_close(fp);
+ (void)isc_stdio_close(fp);
#else /* HAVE_LMDB */
if (txn != NULL)
(void) nzd_close(&txn, ISC_FALSE);
if (result == ISC_R_NOTFOUND) {
removefile = ISC_TRUE;
result = ISC_R_SUCCESS;
+ } else if (result == ISC_R_SUCCESS) {
+ result = isc_stdio_close(fp);
+ fp = NULL;
}
cleanup:
dns_ntatable_detach(&ntatable);
if (fp != NULL)
- isc_stdio_close(fp);
+ (void)isc_stdio_close(fp);
/* Don't leave half-baked NTA save files lying around. */
if (result != ISC_R_SUCCESS || removefile)