]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix autotrust temp file uniqueness windows compile.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 15 Aug 2019 12:02:14 +0000 (14:02 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Thu, 15 Aug 2019 12:02:14 +0000 (14:02 +0200)
doc/Changelog
validator/autotrust.c

index 742c06fdd37d1c8b711b586c1aea58001dcd5a11..ea33f418cc04cf04f797b2c33f917e9128661a7d 100644 (file)
@@ -1,5 +1,6 @@
 15 August 2019: Wouter
        - iana portlist updated.
+       - Fix autotrust temp file uniqueness windows compile.
 
 14 August 2019: George
        - Fix #59, when compiled with systemd support check that we can properly
index 5f20bf5f5c98f1a3ade0e02f27e60f5a3dcc09c8..315934cddb365e33241c9a569b9e450bff01d583 100644 (file)
@@ -1183,8 +1183,13 @@ void autr_write_file(struct module_env* env, struct trust_anchor* tp)
        }
        /* unique name with pid number, thread number, and struct pointer
         * (the pointer uniquifies for multiple libunbound contexts) */
+#ifndef USE_WINSOCK
        snprintf(tempf, sizeof(tempf), "%s.%d-%d-%llx", fname, (int)getpid(),
                env->worker?*(int*)env->worker:0, (long long int)tp);
+#else
+       snprintf(tempf, sizeof(tempf), "%s.%d-%d-%I64x", fname, (int)getpid(),
+               env->worker?*(int*)env->worker:0, (long long int)tp);
+#endif
        verbose(VERB_ALGO, "autotrust: write to disk: %s", tempf);
        out = fopen(tempf, "w");
        if(!out) {