From 4e568d23396bcdec86fc0191cf6e8380feddd192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Mon, 6 Dec 2010 03:49:25 +0300 Subject: [PATCH] W32 unmap fix --- src/util/disk.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/disk.c b/src/util/disk.c index 5d35fa0..b8bc946 100644 --- a/src/util/disk.c +++ b/src/util/disk.c @@ -1484,6 +1484,10 @@ struct GNUNET_DISK_MapHandle * Underlying OS handle. */ HANDLE h; + /** + * Base address of the mapped memory. + */ + void *base; #else /** * Address where the map is in memory. @@ -1564,7 +1568,7 @@ GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, CloseHandle ((*m)->h); GNUNET_free (*m); } - + (*m)->base = ret; return ret; #else int prot; @@ -1603,7 +1607,7 @@ GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h) } #ifdef MINGW - ret = UnmapViewOfFile (h->h) ? GNUNET_OK : GNUNET_SYSERR; + ret = UnmapViewOfFile (h->base) ? GNUNET_OK : GNUNET_SYSERR; if (ret != GNUNET_OK) SetErrnoFromWinError (GetLastError ()); if (!CloseHandle (h->h) && (ret == GNUNET_OK)) -- 1.7.3.1.msysgit.0