diff options
author | Renato Botelho <renato@netgate.com> | 2016-03-07 11:03:11 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-03-07 11:03:11 -0300 |
commit | 81ca6de1be9c20d444d1a292655e4732a9c76539 (patch) | |
tree | f3d51afe9a1f2b88dea2c5e10289db1f3f2ed5d1 /lib/libc | |
parent | 124a553c4366e5f98bf66430356250b0db8eb135 (diff) | |
parent | 81dfa2bb6c9e62b96e6586a82c13db809c03fd20 (diff) | |
download | FreeBSD-src-81ca6de1be9c20d444d1a292655e4732a9c76539.zip FreeBSD-src-81ca6de1be9c20d444d1a292655e4732a9c76539.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/db/hash/hash.c | 6 |
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); } |