aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-08-27 15:18:09 +0000
committerlloyd <[email protected]>2008-08-27 15:18:09 +0000
commit999e3f574b058ad4c19007eb9b2768709bcb62e7 (patch)
tree34d5c2698f5eb510f98c1e77ab1e39a9e10301ee /modules
parent1b20697d57f26f98d226885fd9b755c8c1807344 (diff)
Cleaner flags: define MAP_NOSYNC to zero ifndef, always use it
Diffstat (limited to 'modules')
-rw-r--r--modules/alloc_mmap/mmap_mem.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/alloc_mmap/mmap_mem.cpp b/modules/alloc_mmap/mmap_mem.cpp
index e22c2dac5..e9ea17a53 100644
--- a/modules/alloc_mmap/mmap_mem.cpp
+++ b/modules/alloc_mmap/mmap_mem.cpp
@@ -87,13 +87,13 @@ void* MemoryMapping_Allocator::alloc_block(u32bit n)
if(::write(file.get_fd(), "\0", 1) != 1)
throw MemoryMapping_Failed("Could not write to file");
- int flags = MAP_SHARED;
-
-#ifdef MAP_NOSYNC
- flags |= MAP_NOSYNC;
+#ifndef MAP_NOSYNC
+ #define MAP_NOSYNC 0
#endif
- void* ptr = ::mmap(0, n, PROT_READ | PROT_WRITE, flags,
+ void* ptr = ::mmap(0, n,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_NOSYNC,
file.get_fd(), 0);
if(ptr == static_cast<void*>(MAP_FAILED))