2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

check fwrite results

This commit is contained in:
Mark Andrews 2012-06-23 18:21:52 +10:00
parent fe10cb8b61
commit abeb649619

View File

@ -115,8 +115,13 @@ write_data(FILE *file, unsigned char *datap, isc_uint32_t serial) {
: (char *)(where + sizeof(data_holder_t)));
ret = fwrite(&temp, sizeof(data_holder_t), 1, file);
if (data->len > 0)
if (ret != 1)
return (ISC_R_FAILURE);
if (data->len > 0) {
ret = fwrite(data->data, data->len, 1, file);
if (ret != 1)
return (ISC_R_FAILURE);
}
return (ISC_R_SUCCESS);
}