mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +00:00
win32 mmap() must not close file handle, issue 99
This commit is contained in:
1 parent
fbf1ccee45
commit
3d211d89c5
1 file changed
-1
@@ -3915,7 +3915,6 @@ static void *mmap(void *addr, int64_t len, int prot, int flags, int fd,
|
|||||||
HANDLE fh = (HANDLE) _get_osfhandle(fd);
|
HANDLE fh = (HANDLE) _get_osfhandle(fd);
|
||||||
HANDLE mh = CreateFileMapping(fh, 0, PAGE_READONLY, 0, 0, 0);
|
HANDLE mh = CreateFileMapping(fh, 0, PAGE_READONLY, 0, 0, 0);
|
||||||
void *p = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, (size_t) len);
|
void *p = MapViewOfFile(mh, FILE_MAP_READ, 0, 0, (size_t) len);
|
||||||
CloseHandle(fh);
|
|
||||||
CloseHandle(mh);
|
CloseHandle(mh);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user