From 89c8b298f0ae707a186b988dd079488f812adae0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Apr 2006 09:59:19 +0200 Subject: Bug#17368 General log and slow query log don't work - Port ha_tina.cc to run on windows include/my_sys.h: Add define for MAP_PRIVATE, to be used in my_mmap to decide what kind of map to open. mysys/my_mmap.c: Remove unused flProtect Look at "prot" argument when deciding if map should be read or write. storage/csv/ha_tina.cc: Remove "include ", use the defines and functions from mysys Add cast to byte* when calling 'my_write' Add cast to char* when calling 'buffer.set' munmap the file before setting it's size, my_chsize will fail if file is mapped. storage/csv/ha_tina.h: Remove "typedef" since no name is defined and "tina_set" is used in the code --- mysys/my_mmap.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'mysys') diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c index 21bfddae46c..19d9541a967 100644 --- a/mysys/my_mmap.c +++ b/mysys/my_mmap.c @@ -43,22 +43,19 @@ int my_getpagesize(void) void *my_mmap(void *addr, size_t len, int prot, int flags, int fd, my_off_t offset) { - DWORD flProtect=0; HANDLE hFileMap; LPVOID ptr; HANDLE hFile= (HANDLE)_get_osfhandle(fd); if (hFile == INVALID_HANDLE_VALUE) return MAP_FAILED; - flProtect|=SEC_COMMIT; - hFileMap=CreateFileMapping(hFile, &mmap_security_attributes, PAGE_READWRITE, 0, (DWORD) len, NULL); if (hFileMap == 0) return MAP_FAILED; ptr=MapViewOfFile(hFileMap, - flags & PROT_WRITE ? FILE_MAP_WRITE : FILE_MAP_READ, + prot & PROT_WRITE ? FILE_MAP_WRITE : FILE_MAP_READ, (DWORD)(offset >> 32), (DWORD)offset, len); /* -- cgit v1.2.1