aboutsummaryrefslogtreecommitdiff
path: root/validator/autotrust.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2015-12-12 22:18:57 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2015-12-12 22:18:57 +0000
commita7af7146c91c816cb83e0c5812eca7019531acb5 (patch)
tree6e64b645522115b817ba7eabd4e4ce58f129e8c7 /validator/autotrust.c
parent835a7e7a4dd68819f7610dafdf9277d3852aef6a (diff)
Diffstat (limited to 'validator/autotrust.c')
-rw-r--r--validator/autotrust.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/validator/autotrust.c b/validator/autotrust.c
index e63b086e6a09..f8c9c8c63f94 100644
--- a/validator/autotrust.c
+++ b/validator/autotrust.c
@@ -1195,6 +1195,14 @@ void autr_write_file(struct module_env* env, struct trust_anchor* tp)
fatal_exit("could not completely write: %s", fname);
return;
}
+ if(fflush(out) != 0)
+ log_err("could not fflush(%s): %s", fname, strerror(errno));
+#ifdef HAVE_FSYNC
+ if(fsync(fileno(out)) != 0)
+ log_err("could not fsync(%s): %s", fname, strerror(errno));
+#else
+ FlushFileBuffers((HANDLE)_fileno(out));
+#endif
if(fclose(out) != 0) {
fatal_exit("could not complete write: %s: %s",
fname, strerror(errno));
@@ -2162,7 +2170,7 @@ int autr_process_prime(struct module_env* env, struct val_env* ve,
if(!verify_dnskey(env, ve, tp, dnskey_rrset)) {
verbose(VERB_ALGO, "autotrust: dnskey did not verify.");
/* only increase failure count if this is not the first prime,
- * this means there was a previous succesful probe */
+ * this means there was a previous successful probe */
if(tp->autr->last_success) {
tp->autr->query_failed += 1;
autr_write_file(env, tp);