]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] fix error reporting on fclose() failure [RT #46199]
authorEvan Hunt <each@isc.org>
Thu, 5 Oct 2017 18:07:21 +0000 (11:07 -0700)
committerEvan Hunt <each@isc.org>
Thu, 5 Oct 2017 18:07:21 +0000 (11:07 -0700)
bin/dnssec/dnssec-cds.c

index 2eafa11ede1fd08e127b6399b47c298ebc00b689..521f7bd7aae9dcedda86cc180d47aa2ffc10d5ea 100644 (file)
@@ -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);