summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-04-13 01:54:36 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-04-13 01:54:36 +0000
commit4e6bbd6d779cabfaeba3bb158b9b7b8cf8c9d8fb (patch)
treecb2f8240de60480aaef1cf391436cf1445ebf2bc
parent57d12b01ce8192ab82a77fcdffb4a187f66e81be (diff)
downloadFreeBSD-src-4e6bbd6d779cabfaeba3bb158b9b7b8cf8c9d8fb.zip
FreeBSD-src-4e6bbd6d779cabfaeba3bb158b9b7b8cf8c9d8fb.tar.gz
MFC r297626:
Follow-up r295924: Only sync hash-based db files open for writing when closing.
-rw-r--r--lib/libc/db/hash/hash.c3
1 files changed, 2 insertions, 1 deletions
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);
}
OpenPOWER on IntegriCloud