summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 9547c3033..faecd47f0 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 4ad970ae8..e1fc2d621 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;