summaryrefslogtreecommitdiff
path: root/source3/lib/tdb/common/transaction.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-09-03 10:44:09 -0400
committerSimo Sorce <idra@samba.org>2008-09-03 14:25:33 -0400
commit04691de379fa692b22fc9f0b58c0bd829ce7cc7a (patch)
treef5b920a8355ff1f5786c40920081273c6f27ae17 /source3/lib/tdb/common/transaction.c
parentc5894e14771562bccd153a98610722632ca3956a (diff)
downloadsamba-04691de379fa692b22fc9f0b58c0bd829ce7cc7a.tar.gz
samba-04691de379fa692b22fc9f0b58c0bd829ce7cc7a.tar.bz2
samba-04691de379fa692b22fc9f0b58c0bd829ce7cc7a.zip
The msync manpage reports that msync *must* be called before munmap. Failure to do so may result in lost data. Fix an ifdef check, I really think we meant to check HAVE_MMAP here.
(This used to be commit 74c8575b3f3b90ea21ae6aa7ccd95947838af956)
Diffstat (limited to 'source3/lib/tdb/common/transaction.c')
-rw-r--r--source3/lib/tdb/common/transaction.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/tdb/common/transaction.c b/source3/lib/tdb/common/transaction.c
index 4e2127be64..7acda640c8 100644
--- a/source3/lib/tdb/common/transaction.c
+++ b/source3/lib/tdb/common/transaction.c
@@ -563,7 +563,7 @@ static int transaction_sync(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction: fsync failed\n"));
return -1;
}
-#ifdef MS_SYNC
+#ifdef HAVE_MMAP
if (tdb->map_ptr) {
tdb_off_t moffset = offset & ~(tdb->page_size-1);
if (msync(moffset + (char *)tdb->map_ptr,