]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- fix for windows, rename() is not posix compliant on windows.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 3 Feb 2012 14:56:09 +0000 (14:56 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 3 Feb 2012 14:56:09 +0000 (14:56 +0000)
git-svn-id: file:///svn/unbound/trunk@2605 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
validator/autotrust.c

index 78f7df246df93d32dccca4f282c3bc6bc33fdeff..abe454bf36a05679d488b5933a288dd653b80240 100644 (file)
@@ -1,3 +1,6 @@
+3 February 2012: Wouter
+       - fix for windows, rename() is not posix compliant on windows.
+
 2 February 2012: Wouter
        - 1.4.16 release tag.
        - svn trunk is 1.4.17 in development.
index 8c3a7c67221ef4a0a629df7c6597f1c8290c27fc..9896943245e44fe7c980eb06c0ec30b721aca0cf 100644 (file)
@@ -996,6 +996,9 @@ void autr_write_file(struct module_env* env, struct trust_anchor* tp)
        /* success; overwrite actual file */
        fclose(out);
        verbose(VERB_ALGO, "autotrust: replaced %s", fname);
+#ifdef UB_ON_WINDOWS
+       (void)unlink(fname); /* windows does not replace file with rename() */
+#endif
        if(rename(tempf, fname) < 0) {
                log_err("rename(%s to %s): %s", tempf, fname, strerror(errno));
        }