From 4e6bbd6d779cabfaeba3bb158b9b7b8cf8c9d8fb Mon Sep 17 00:00:00 2001 From: bdrewery Date: Wed, 13 Apr 2016 01:54:36 +0000 Subject: MFC r297626: Follow-up r295924: Only sync hash-based db files open for writing when closing. --- lib/libc/db/hash/hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 333b1a1..12220a9 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -423,7 +423,8 @@ hdestroy(HTAB *hashp) free(hashp->tmp_buf); if (hashp->fp != -1) { - (void)_fsync(hashp->fp); + if (hashp->save_file) + (void)_fsync(hashp->fp); (void)_close(hashp->fp); } -- cgit v1.1