summaryrefslogtreecommitdiffstats
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-01-24 04:00:41 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-01-24 04:00:41 +0000
commit174f1a392e5cf411710edaa212545e208270b24a (patch)
tree570a1ce481e21d9f118ce89491b407bc34a5379c /winsup
parent1d8bdab0d59787347faec41fde9e8d410404d108 (diff)
downloadcygnal-174f1a392e5cf411710edaa212545e208270b24a.tar.gz
cygnal-174f1a392e5cf411710edaa212545e208270b24a.tar.bz2
cygnal-174f1a392e5cf411710edaa212545e208270b24a.zip
* mmap.cc (fhandler_disk_file::mmap): Call CreateFileMapping with
len != 0 only when performing an anonymous mapping.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/mmap.cc9
2 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index e663eccaa..6dfb911dd 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jan 23 21:56:00 2001 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (fhandler_disk_file::mmap): Call CreateFileMapping with
+ len != 0 only when performing an anonymous mapping.
+
Mon Jan 22 15:35:28 2001 Christopher Faylor <cgf@cygnus.com>
* path.h: Add a new constant.
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 ();