From 3f3b51e7af0400e0aaf9c53d1faa9d5cc910f4a9 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Thu, 5 Oct 2017 11:07:21 -0700 Subject: [PATCH] [master] fix error reporting on fclose() failure [RT #46199] --- bin/dnssec/dnssec-cds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/dnssec/dnssec-cds.c b/bin/dnssec/dnssec-cds.c index 2eafa11ede..521f7bd7aa 100644 --- a/bin/dnssec/dnssec-cds.c +++ b/bin/dnssec/dnssec-cds.c @@ -448,9 +448,9 @@ write_parent_set(const char *path, const char *inplace, fprintf(fp, "%s", (char *)r.base); isc_buffer_free(&buf); if (fclose(fp) == EOF) { - result = ISC_R_FAILURE; + int err = errno; 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);