From ee2b4ec959b5813eb2105ea068ae3f725b106a3b Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Fri, 18 Mar 2005 16:12:25 -0800 Subject: Eliminate warnings noticed by VC7. This includes fixing my_mmap() on Windows to call CreateFileMapping() with correct arguments, and propogating the introduction of query_id_t to everywhere query ids are passed around. (Bug #8826) --- mysys/my_mmap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mysys/my_mmap.c') diff --git a/mysys/my_mmap.c b/mysys/my_mmap.c index a111c3dc571..cd84630a761 100644 --- a/mysys/my_mmap.c +++ b/mysys/my_mmap.c @@ -46,11 +46,14 @@ void *my_mmap(void *addr, size_t len, int prot, 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(fd, NULL, &mmap_security_attributes, - PAGE_READWRITE, 0, len, 0); + hFileMap=CreateFileMapping(hFile, &mmap_security_attributes, + PAGE_READWRITE, 0, len, NULL); if (hFileMap == 0) return MAP_FAILED; -- cgit v1.2.1