diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2019-03-14 01:26:16 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2019-03-14 01:26:16 +0100 |
| commit | bd22513c86b7a00c0c25f2cc6f5dfbcf67076da0 (patch) | |
| tree | 6a13805f0f41e7ffb4e152d6088f4803dec5d277 /src/platform/windows.c | |
| parent | 5e4b1548315976918cd755eca72ec47a53096be4 (diff) | |
| download | cc4group-bd22513c86b7a00c0c25f2cc6f5dfbcf67076da0.tar.gz cc4group-bd22513c86b7a00c0c25f2cc6f5dfbcf67076da0.zip | |
Fix creation of tmpfile in windows (hopefully. deletion still fails)
Diffstat (limited to 'src/platform/windows.c')
| -rw-r--r-- | src/platform/windows.c | 6 |
1 files changed, 2 insertions, 4 deletions
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) { |
