summaryrefslogtreecommitdiff
path: root/source3/lib/tdb/common/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/tdb/common/io.c')
-rw-r--r--source3/lib/tdb/common/io.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/lib/tdb/common/io.c b/source3/lib/tdb/common/io.c
index 172ab69d8c..4ec18de48e 100644
--- a/source3/lib/tdb/common/io.c
+++ b/source3/lib/tdb/common/io.c
@@ -189,7 +189,13 @@ int tdb_munmap(struct tdb_context *tdb)
#ifdef HAVE_MMAP
if (tdb->map_ptr) {
- int ret = munmap(tdb->map_ptr, tdb->map_size);
+ int ret;
+
+ ret = msync(tdb->map_ptr, tdb->map_size, MS_SYNC);
+ if (ret != 0)
+ return ret;
+
+ ret = munmap(tdb->map_ptr, tdb->map_size);
if (ret != 0)
return ret;
}