From 281bd334ac254ee5b9c875f55980444069489395 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 9 Jul 2007 17:02:37 +0000 Subject: * dir.cc (closedir): Revert change from 2007-06-29. * fhandler.h (dirent_valid_fd): Drop. * fhandler_disk_file.cc (fhandler_disk_file::opendir): If opening a real dir, use the underlying fhandler to keep track of the directory handle. In fdopendir case use original io_handle from fhandler. Use fhandler's io_handle in subsequent directory functions throughout. Create handle non-inheritable and set close-on-exec flag. (readdir_get_ino): Drop dirent_isroot case. (fhandler_disk_file::readdir): Handle dirent_isroot case here. (fhandler_disk_file::rewinddir): Revert change from 2007-07-05. Use NtClose instead of CloseHandle. * fhandler_virtual.cc (fhandler_virtual::opendir): Drop adding dirent_valid_fd flag. Set close-on-exec flag. --- winsup/cygwin/dir.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'winsup/cygwin/dir.cc') diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index 2ce0488c5..822a5e5fe 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -260,11 +260,7 @@ closedir (DIR *dir) int res = ((fhandler_base *) dir->__fh)->closedir (dir); - /* If the directory has been opened by fdopendir, the descriptor - entry is used elsewhere in the application and must not be removed - from the descriptor table. */ - if (!(dir->__flags & dirent_valid_fd)) - cygheap->fdtab.release (dir->__d_fd); + cygheap->fdtab.release (dir->__d_fd); free (dir->__d_dirname); free (dir->__d_dirent); -- cgit v1.2.3