summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-11-21 20:58:08 +0100
committerJeremy Allison <jra@samba.org>2016-11-29 20:03:25 +0100
commit5ce95abf37d5646dd5a6ed9acc018f0ab5d1023c (patch)
treea62133402d774c62066c56c8eabf76b30c1f753b /lib
parenta2843cfd4dca32ccb9e97f20a9119f131db3b9d1 (diff)
downloadsamba-5ce95abf37d5646dd5a6ed9acc018f0ab5d1023c.tar.gz
tdb: Only mmap the mutex area if not already mmap'ed
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12455 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tdb/common/mutex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tdb/common/mutex.c b/lib/tdb/common/mutex.c
index 3420d21f348..3df9f5b06ad 100644
--- a/lib/tdb/common/mutex.c
+++ b/lib/tdb/common/mutex.c
@@ -623,6 +623,10 @@ int tdb_mutex_mmap(struct tdb_context *tdb)
return 0;
}
+ if (tdb->mutexes != NULL) {
+ return 0;
+ }
+
ptr = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FILE,
tdb->fd, 0);
if (ptr == MAP_FAILED) {