Commit 3f3b51e7 authored by Evan Hunt's avatar Evan Hunt

[master] fix error reporting on fclose() failure [RT #46199]

parent c6a63672
...@@ -448,9 +448,9 @@ write_parent_set(const char *path, const char *inplace, ...@@ -448,9 +448,9 @@ write_parent_set(const char *path, const char *inplace,
fprintf(fp, "%s", (char *)r.base); fprintf(fp, "%s", (char *)r.base);
isc_buffer_free(&buf); isc_buffer_free(&buf);
if (fclose(fp) == EOF) { if (fclose(fp) == EOF) {
result = ISC_R_FAILURE; int err = errno;
isc_file_remove(tmpname); isc_file_remove(tmpname);
fatal("error writing to %s: %s", tmpname, strerror(result)); fatal("error writing to %s: %s", tmpname, strerror(err));
} }
isc_time_set(&filetime, oldestsig.timesigned, 0); isc_time_set(&filetime, oldestsig.timesigned, 0);
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