1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Commit changes on memory mapping that hopefully should now work on Linux.

modified:
  storage/connect/maputil.cpp
  storage/connect/tabdos.cpp
  storage/connect/tabfmt.cpp
  storage/connect/tabvct.cpp
This commit is contained in:
Olivier Bertrand
2013-03-08 18:29:05 +01:00
parent 6e6e34b19d
commit 3342df63ef
4 changed files with 4 additions and 16 deletions

View File

@@ -159,9 +159,9 @@ HANDLE CreateFileMap(PGLOBAL g, LPCSTR fileName,
// Now we are ready to load the file. If mmap() is available we try
// this first. If not available or it failed we try to load it.
mm->memory = mmap(NULL, filesize, protmode, MAP_PRIVATE, fd, 0);
mm->memory = mmap(NULL, filesize, protmode, MAP_SHARED, fd, 0);
if (mm->memory) {
if (mm->memory != MAP_FAILED) {
mm->lenL = (mm->memory != 0) ? filesize : 0;
mm->lenH = 0;
} else {
@@ -180,7 +180,7 @@ bool CloseMemMap(void *memory, size_t dwSize)
if (memory) {
// All this must be redesigned
int rc = msync(memory, dwSize, MS_SYNC);
return (munmap(memory, dwSize)) ? true : false;
return (munmap(memory, dwSize) < 0) ? true : false;
} else
return false;