From: Juho S. <js...@us...> - 2006-09-07 02:14:35
|
Update of /cvsroot/sbcl/sbcl/src/runtime In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27754/src/runtime Modified Files: win32-os.c Log Message: 0.9.16.20: Some win32 cleanups (patch by Jack Unrue on sbcl-devel, 2006-08-31). * Replace remaining calls to perror() with fprintf(stderr, ..., GetLastError()) since errno is not set by Win32 API calls. * Disable debug output from os_map(). Index: win32-os.c =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/runtime/win32-os.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- win32-os.c 18 Jun 2006 19:11:32 -0000 1.15 +++ win32-os.c 7 Sep 2006 01:58:12 -0000 1.16 @@ -146,7 +146,7 @@ /* the simple case first */ os_vm_address_t real_addr; if (!(real_addr = VirtualAlloc(addr, len, MEM_COMMIT, PAGE_EXECUTE_READWRITE))) { - perror("VirtualAlloc"); + fprintf(stderr, "VirtualAlloc: 0x%lx.\n", GetLastError()); return 0; } @@ -154,7 +154,7 @@ } if (!VirtualQuery(addr, &mem_info, sizeof mem_info)) { - perror("VirtualQuery"); + fprintf(stderr, "VirtualQuery: 0x%lx.\n", GetLastError()); return 0; } @@ -166,7 +166,7 @@ } if (!VirtualAlloc(addr, len, (mem_info.State == MEM_RESERVE)? MEM_COMMIT: MEM_RESERVE, PAGE_EXECUTE_READWRITE)) { - perror("VirtualAlloc"); + fprintf(stderr, "VirtualAlloc: 0x%lx.\n", GetLastError()); return 0; } @@ -192,7 +192,7 @@ os_invalidate(os_vm_address_t addr, os_vm_size_t len) { if (!VirtualFree(addr, len, MEM_DECOMMIT)) { - perror("VirtualFree"); + fprintf(stderr, "VirtualFree: 0x%lx.\n", GetLastError()); } } @@ -212,11 +212,13 @@ { os_vm_size_t count; +#if 0 fprintf(stderr, "os_map: %d, 0x%x, %p, 0x%x.\n", fd, offset, addr, len); fflush(stderr); +#endif if (!VirtualAlloc(addr, len, MEM_COMMIT, PAGE_EXECUTE_READWRITE)) { - perror("VirtualAlloc"); + fprintf(stderr, "VirtualAlloc: 0x%lx.\n", GetLastError()); lose("os_map: VirtualAlloc failure"); } |