diff options
author | gjb <gjb@FreeBSD.org> | 2016-02-23 16:01:34 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2016-02-23 16:01:34 +0000 |
commit | bd77e66df8966f36b8c317fd5ecc91ee839c2b3f (patch) | |
tree | ca20f76b53a548e6a814eb9e4aa00652a1cebf70 /lib/libc | |
parent | 8bfb527a82b3844c875182139d053826902f90d6 (diff) | |
parent | b5836dc86468066c8b641bf65cbfc5e18cef67da (diff) | |
download | FreeBSD-src-bd77e66df8966f36b8c317fd5ecc91ee839c2b3f.zip FreeBSD-src-bd77e66df8966f36b8c317fd5ecc91ee839c2b3f.tar.gz |
MFH
Sponsored by: The FreeBSD Foundation
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 e6da5fe..02503ee 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); } |