* fhandler_disk_file.cc (fhandler_disk_file::closedir): Fix bug

introduced by switching to NtClose.
This commit is contained in:
Corinna Vinschen 2007-02-22 15:07:21 +00:00
parent 39fc0d36ae
commit e387a378b4
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-02-22 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::closedir): Fix bug
introduced by switching to NtClose.
2007-02-22 Christopher Faylor <me@cgf.cx> 2007-02-22 Christopher Faylor <me@cgf.cx>
* dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of

View File

@ -1873,6 +1873,8 @@ int
fhandler_disk_file::closedir (DIR *dir) fhandler_disk_file::closedir (DIR *dir)
{ {
int res = 0; int res = 0;
NTSTATUS status;
delete d_mounts (dir); delete d_mounts (dir);
if (!dir->__handle) if (!dir->__handle)
/* ignore */; /* ignore */;
@ -1881,9 +1883,9 @@ fhandler_disk_file::closedir (DIR *dir)
set_errno (EBADF); set_errno (EBADF);
res = -1; res = -1;
} }
else if (!NtClose (dir->__handle)) else if (!NT_SUCCESS (status = NtClose (dir->__handle)))
{ {
__seterrno (); __seterrno_from_nt_status (status);
res = -1; res = -1;
} }
syscall_printf ("%d = closedir (%p, %s)", res, dir, get_name ()); syscall_printf ("%d = closedir (%p, %s)", res, dir, get_name ());