* 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.
This commit is contained in:
Corinna Vinschen
2007-07-09 17:02:37 +00:00
parent bffcbe34be
commit 281bd334ac
5 changed files with 83 additions and 82 deletions

View File

@@ -80,7 +80,6 @@ fhandler_virtual::opendir (int fd)
if (fd >= 0)
{
dir->__flags |= dirent_valid_fd;
dir->__d_fd = fd;
res = dir;
dir->__fh = this;
@@ -98,6 +97,7 @@ fhandler_virtual::opendir (int fd)
res = dir;
}
}
close_on_exec (true);
}
syscall_printf ("%p = opendir (%s)", res, get_name ());