diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2019-03-18 19:45:34 +0100 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2019-03-18 19:45:34 +0100 |
| commit | ec6f8c4fe162500645109eb24856051c97bfb2fe (patch) | |
| tree | 95cc40de4f88c3d1e1ee4dcac1b093df984126ec /src/platform/windows.c | |
| parent | 984c5b553954ebed29d01b29083323e03f78ac9d (diff) | |
| download | cc4group-ec6f8c4fe162500645109eb24856051c97bfb2fe.tar.gz cc4group-ec6f8c4fe162500645109eb24856051c97bfb2fe.zip | |
Remove the extra argument from cc4group_mmap and cc4group_munmap as its actually not needed
Diffstat (limited to 'src/platform/windows.c')
| -rw-r--r-- | src/platform/windows.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/platform/windows.c b/src/platform/windows.c index bd1016c..53d5038 100644 --- a/src/platform/windows.c +++ b/src/platform/windows.c @@ -17,8 +17,6 @@ #include <windows.h> #include <sys/types.h> -#include <stdio.h> - #include "platform.h" #ifdef __USE_FILE_OFFSET64 @@ -29,7 +27,7 @@ # define DWORD_LO(x) (x) #endif -void *cc4group_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset, void** extra) +void *cc4group_mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) { (void)start; if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) @@ -83,22 +81,19 @@ void *cc4group_mmap(void *start, size_t length, int prot, int flags, int fd, off dwDesiredAccess |= FILE_MAP_EXECUTE; void *ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length); + CloseHandle(h); if (ret == NULL) { - CloseHandle(h); ret = MAP_FAILED; } - *extra = h; return ret; } -int cc4group_munmap(void *addr, size_t length, void* extra) +int cc4group_munmap(void *addr, size_t length) { (void)length; UnmapViewOfFile(addr); - CloseHandle(extra); - /* ruh-ro, we leaked handle from CreateFileMapping() ... */ return 0; } |
