diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-02-22 18:07:21 +0300 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-02-22 18:07:21 +0300 |
commit | e387a378b452c5524665b149af41779c416134fa (patch) | |
tree | 8487324d3236baadc1cd81aa2b392b7e7e2ccd61 /winsup | |
parent | 39fc0d36aefea70fa97addbeaf1f8e9ac0fa8232 (diff) |
* fhandler_disk_file.cc (fhandler_disk_file::closedir): Fix bug
introduced by switching to NtClose.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 37f3dd9f0..8c99c3c42 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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> * dcrt0.cc (child_info_fork::alloc_stack_hard_way): Change sense of diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 94a94b8fa..9bc7b834a 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -1873,6 +1873,8 @@ int fhandler_disk_file::closedir (DIR *dir) { int res = 0; + NTSTATUS status; + delete d_mounts (dir); if (!dir->__handle) /* ignore */; @@ -1881,9 +1883,9 @@ fhandler_disk_file::closedir (DIR *dir) set_errno (EBADF); res = -1; } - else if (!NtClose (dir->__handle)) + else if (!NT_SUCCESS (status = NtClose (dir->__handle))) { - __seterrno (); + __seterrno_from_nt_status (status); res = -1; } syscall_printf ("%d = closedir (%p, %s)", res, dir, get_name ()); |