From 9d3689618d079c7776ca899134a25c0ad05f0ee3 Mon Sep 17 00:00:00 2001 From: corinna Date: Wed, 19 Jul 2006 08:58:09 +0000 Subject: [PATCH] * mmap.cc (msync): Disable rounding up len. Fix bug in access check loop. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/mmap.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 777e1af994..765e5d23e3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2006-07-19 Corinna Vinschen + * mmap.cc (msync): Disable rounding up len. Fix bug in access check + loop. + +2006-07-19 Corinna Vinschen + * path.cc (symlink_worker): Return EEXIST if newpath exists. 2006-07-18 Christopher Faylor diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 5ace55c0a1..97966515ee 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -1352,7 +1352,9 @@ msync (void *addr, size_t len, int flags) set_errno (EINVAL); goto out; } +#if 0 /* If I only knew why I did that... */ len = roundup2 (len, pagesize); +#endif /* Iterate through the map, looking for the mmapped area. Error if not found. */ @@ -1368,7 +1370,7 @@ msync (void *addr, size_t len, int flags) if (rec->access ((caddr_t)addr)) { /* Check whole area given by len. */ - for (DWORD i = getpagesize (); i < len; ++i) + for (DWORD i = getpagesize (); i < len; i += getpagesize ()) if (!rec->access ((caddr_t)addr + i)) { set_errno (ENOMEM); -- 2.11.0