OSDN Git Service

* mmap.cc (map::get_list_by_fd): Avoid calling `get_namehash' when
authorcorinna <corinna>
Mon, 19 Mar 2001 13:33:51 +0000 (13:33 +0000)
committercorinna <corinna>
Mon, 19 Mar 2001 13:33:51 +0000 (13:33 +0000)
        file descriptor is -1.

winsup/cygwin/ChangeLog
winsup/cygwin/mmap.cc

index 9547c30..faecd47 100644 (file)
@@ -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.
index 4ad970a..e1fc2d6 100644 (file)
@@ -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;