[or-cvs] r17493: {tor} Try to fix windows mmap code. (tor/trunk/src/common)

nickm at seul.org nickm at seul.org
Fri Dec 5 19:36:38 UTC 2008


Author: nickm
Date: 2008-12-05 14:36:35 -0500 (Fri, 05 Dec 2008)
New Revision: 17493

Modified:
   tor/trunk/src/common/compat.c
Log:
Try to fix windows mmap code.

Modified: tor/trunk/src/common/compat.c
===================================================================
--- tor/trunk/src/common/compat.c	2008-12-05 18:07:34 UTC (rev 17492)
+++ tor/trunk/src/common/compat.c	2008-12-05 19:36:35 UTC (rev 17493)
@@ -178,7 +178,7 @@
 tor_mmap_t *
 tor_mmap_file(const char *filename)
 {
-  tor_mmap_t *res = tor_malloc_zero(sizeof(win_mmap_t));
+  tor_mmap_t *res = tor_malloc_zero(sizeof(tor_mmap_t));
   int empty = 0;
   res->file_handle = INVALID_HANDLE_VALUE;
   res->mmap_handle = NULL;
@@ -209,7 +209,7 @@
 #else
                                        0,
 #endif
-                                       (res->base.size & 0xfffffffful),
+                                       (res->size & 0xfffffffful),
                                        NULL);
   if (res->mmap_handle == NULL)
     goto win_err;
@@ -247,9 +247,9 @@
     UnmapViewOfFile( (LPVOID) handle->data);
 
   if (handle->mmap_handle != NULL)
-    CloseHandle(h->mmap_handle);
+    CloseHandle(handle->mmap_handle);
   if (handle->file_handle != INVALID_HANDLE_VALUE)
-    CloseHandle(h->file_handle);
+    CloseHandle(handle->file_handle);
   tor_free(handle);
 }
 #else



More information about the tor-commits mailing list