From: W.C.A. Wijngaards Date: Thu, 15 Aug 2019 12:02:14 +0000 (+0200) Subject: - Fix autotrust temp file uniqueness windows compile. X-Git-Tag: release-1.9.3rc1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d9884c442958c29a83ab5102ece9e2ff12fc18e;p=thirdparty%2Funbound.git - Fix autotrust temp file uniqueness windows compile. --- diff --git a/doc/Changelog b/doc/Changelog index 742c06fdd..ea33f418c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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 diff --git a/validator/autotrust.c b/validator/autotrust.c index 5f20bf5f5..315934cdd 100644 --- a/validator/autotrust.c +++ b/validator/autotrust.c @@ -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) {