summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-03-07 11:04:11 -0300
committerRenato Botelho <renato@netgate.com>2016-03-07 11:04:11 -0300
commit2cb9037172ce155f30b73a0605c0a9f0ec20ad24 (patch)
treee04090dcf9f53b3375b670d71a1b43e5902aee42 /lib
parent5a7f68ff1a4cfedfb123a6ce621c19a5cf7373be (diff)
parent8526db178678c940e9594ff82ef9746ae465950d (diff)
downloadFreeBSD-src-2cb9037172ce155f30b73a0605c0a9f0ec20ad24.zip
FreeBSD-src-2cb9037172ce155f30b73a0605c0a9f0ec20ad24.tar.gz
Merge remote-tracking branch 'origin/releng/10.3' into RELENG_2_3
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/db/hash/hash.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c
index af80929..333b1a1 100644
--- a/lib/libc/db/hash/hash.c
+++ b/lib/libc/db/hash/hash.c
@@ -422,8 +422,10 @@ hdestroy(HTAB *hashp)
if (hashp->tmp_buf)
free(hashp->tmp_buf);
- if (hashp->fp != -1)
+ if (hashp->fp != -1) {
+ (void)_fsync(hashp->fp);
(void)_close(hashp->fp);
+ }
free(hashp);
@@ -458,6 +460,8 @@ hash_sync(const DB *dbp, u_int32_t flags)
return (0);
if (__buf_free(hashp, 0, 1) || flush_meta(hashp))
return (ERROR);
+ if (hashp->fp != -1 && _fsync(hashp->fp) != 0)
+ return (ERROR);
hashp->new_file = 0;
return (0);
}
OpenPOWER on IntegriCloud