Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-01-24 07:00:41 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-01-24 07:00:41 +0300
commit174f1a392e5cf411710edaa212545e208270b24a (patch)
tree570a1ce481e21d9f118ce89491b407bc34a5379c /winsup/cygwin/mmap.cc
parent1d8bdab0d59787347faec41fde9e8d410404d108 (diff)
* mmap.cc (fhandler_disk_file::mmap): Call CreateFileMapping with
len != 0 only when performing an anonymous mapping.
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r--winsup/cygwin/mmap.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 70cb36737..354bcaee6 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -1,6 +1,6 @@
/* mmap.cc
- Copyright 1996, 1997, 1998, 2000 Cygnus Solutions.
+ Copyright 1996, 1997, 1998, 2000, 2001 Cygnus Solutions.
This file is part of Cygwin.
@@ -689,7 +689,12 @@ fhandler_disk_file::mmap (caddr_t *addr, size_t len, DWORD access,
else
protect = PAGE_READONLY;
- HANDLE h = CreateFileMapping (get_handle(), &sec_none, protect, 0, len, NULL);
+ HANDLE h = CreateFileMapping (get_handle (),
+ &sec_none,
+ protect,
+ 0,
+ get_handle () == INVALID_HANDLE_VALUE ? len : 0,
+ NULL);
if (h == 0)
{
__seterrno ();