aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-03-19 13:33:51 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-03-19 13:33:51 +0000
commit98750a84047ec2ab23c3c74006e29319ce66e595 (patch)
tree4574c736352a6b51b6dabebef6225d4fb85e8fde /winsup
parentca05a71296f2a1e650b5a4368624351bc6522979 (diff)
downloadnewlib-98750a84047ec2ab23c3c74006e29319ce66e595.zip
newlib-98750a84047ec2ab23c3c74006e29319ce66e595.tar.gz
newlib-98750a84047ec2ab23c3c74006e29319ce66e595.tar.bz2
* mmap.cc (map::get_list_by_fd): Avoid calling `get_namehash' when
file descriptor is -1.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/mmap.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 9547c30..faecd47 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 19 14:32:00 2001 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (map::get_list_by_fd): Avoid calling `get_namehash' when
+ file descriptor is -1.
+
Sat Mar 17 18:30:00 2001 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (check_posix_perm): New static function.
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index 4ad970a..e1fc2d6 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -313,7 +313,7 @@ map::get_list_by_fd (int fd)
#else /* so we use the name hash value to identify the file unless
it's not an anonymous mapping. */
if ((fd == -1 && lists[i]->fd == -1)
- || lists[i]->hash == fdtab[fd]->get_namehash ())
+ || (fd != -1 && lists[i]->hash == fdtab[fd]->get_namehash ()))
#endif
return lists[i];
return 0;