summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2004-07-15 09:21:16 +0000
committerCorinna Vinschen <corinna@vinschen.de>2004-07-15 09:21:16 +0000
commit5ba42c7f4c94e026fca8ba064aa106d89852a8a8 (patch)
tree11f1474c495484a1231b7907bf0c5102d72962ad
parenta671e18c4251a06f39f772e9716270621c9ece23 (diff)
downloadcygnal-5ba42c7f4c94e026fca8ba064aa106d89852a8a8.tar.gz
cygnal-5ba42c7f4c94e026fca8ba064aa106d89852a8a8.tar.bz2
cygnal-5ba42c7f4c94e026fca8ba064aa106d89852a8a8.zip
* mmap.cc (class mmap_record): Fix return type of get_offset.
(mmap_record::fixup_page_map): Fix off by one error. (list::search_record): Use long as type of "start" argument in both, declaration and definition. Use long as type for local variable "i".
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/mmap.cc8
2 files changed, 11 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 839f3a5e3..7c382e380 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2004-07-15 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (class mmap_record): Fix return type of get_offset.
+ (mmap_record::fixup_page_map): Fix off by one error.
+ (list::search_record): Use long as type of "start" argument in both,
+ declaration and definition. Use long as type for local variable "i".
+
2004-07-14 Dave Korn <dk@artimi.com>
* fhandler_registry.cc (registry_listing): Correct typo.
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 394ed5987..e2a25de52 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -82,7 +82,7 @@ class mmap_record
HANDLE get_handle () const { return mapping_handle_; }
device& get_device () { return dev; }
DWORD get_access () const { return access_mode_; }
- DWORD get_offset () const { return offset_; }
+ _off64_t get_offset () const { return offset_; }
DWORD get_size () const { return size_to_map_; }
caddr_t get_address () const { return base_address_; }
@@ -273,7 +273,7 @@ mmap_record::fixup_page_map ()
}
for (DWORD off = PAGE_CNT (size_to_map_); off > 0; --off)
- VirtualProtect (base_address_ + off * getpagesize (), getpagesize (),
+ VirtualProtect (base_address_ + (off - 1) * getpagesize (), getpagesize (),
MAP_ISSET (off - 1) ? prot : PAGE_NOACCESS, &old_prot);
}
@@ -358,11 +358,11 @@ list::search_record (_off64_t off, DWORD len)
/* Used in munmap() */
long
list::search_record (caddr_t addr, DWORD len, caddr_t &m_addr, DWORD &m_len,
- _off_t start)
+ long start)
{
caddr_t low, high;
- for (int i = start + 1; i < nrecs; ++i)
+ for (long i = start + 1; i < nrecs; ++i)
{
low = (addr >= recs[i].get_address ()) ? addr : recs[i].get_address ();
high = recs[i].get_address ()