summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cc4group.c2
-rw-r--r--src/platform/windows.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/cc4group.c b/src/cc4group.c
index fb2036e..368b6aa 100644
--- a/src/cc4group.c
+++ b/src/cc4group.c
@@ -249,7 +249,7 @@ static void* cc4group_createTmpMemoryFile(CC4Group* const this, const size_t siz
{
void* ret;
#define TMP_FILE "cc4group.tmp"
- int tmpFile = open(TMP_FILE, O_CREAT | O_BINARY | O_RDWR | O_TRUNC | O_EXCL, 0600);
+ int tmpFile = open(TMP_FILE, O_CREAT | O_BINARY | O_RDWR | O_EXCL, 0600);
if(tmpFile == -1)
{
SET_ERRNO_ERROR("open: Opening tmp file \"" TMP_FILE "\"");
diff --git a/src/platform/windows.c b/src/platform/windows.c
index fb37837..bd1016c 100644
--- a/src/platform/windows.c
+++ b/src/platform/windows.c
@@ -43,13 +43,13 @@ void *cc4group_mmap(void *start, size_t length, int prot, int flags, int fd, off
DWORD flProtect;
if (prot & PROT_WRITE) {
if (prot & PROT_EXEC) {
- if(prot & MAP_PRIVATE)
+ if(flags & MAP_PRIVATE)
flProtect = PAGE_EXECUTE_WRITECOPY;
else
flProtect = PAGE_EXECUTE_READWRITE;
}
else {
- if(prot & MAP_PRIVATE)
+ if(flags & MAP_PRIVATE)
flProtect = PAGE_WRITECOPY;
else
flProtect = PAGE_READWRITE;
@@ -81,8 +81,6 @@ void *cc4group_mmap(void *start, size_t length, int prot, int flags, int fd, off
dwDesiredAccess = FILE_MAP_READ;
if (prot & PROT_EXEC)
dwDesiredAccess |= FILE_MAP_EXECUTE;
- if (flags & MAP_PRIVATE)
- dwDesiredAccess |= FILE_MAP_COPY;
void *ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length);
if (ret == NULL) {