Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-10-24 18:02:32 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-10-24 18:02:32 +0400
commit53e93974c8b3f68a5b6b657c8aff9462d62a24cd (patch)
tree38f3e940fc50458dcc6a6e74f4c4b58c6e563700 /winsup/cygwin/syscalls.cc
parentb3480fbefbcf44d95dbf47d3e25e1eb6e1bb725a (diff)
* syscalls.cc (unlink_nt): Fix a bug which overwrites the NT status
value in case setting the delete disposition returns with STATUS_DIRECTORY_NOT_EMPTY.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index faaa42a34..ce9bceb0b 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -695,20 +695,22 @@ unlink_nt (path_conv &pc)
{
debug_printf ("Setting delete disposition on %S failed, status = %p",
pc.get_nt_native_path (), status);
- if (status == STATUS_DIRECTORY_NOT_EMPTY)
+ if (strace.active () && status == STATUS_DIRECTORY_NOT_EMPTY)
{
+ NTSTATUS status2;
+
pc.get_object_attr (attr, sec_none_nih);
NtClose (fh);
- status = NtOpenFile (&fh, access | FILE_LIST_DIRECTORY | SYNCHRONIZE,
- &attr, &io, FILE_SHARE_VALID_FLAGS,
- flags | FILE_SYNCHRONOUS_IO_NONALERT);
- if (NT_SUCCESS (status))
+ status2 = NtOpenFile (&fh, access | FILE_LIST_DIRECTORY | SYNCHRONIZE,
+ &attr, &io, FILE_SHARE_VALID_FLAGS,
+ flags | FILE_SYNCHRONOUS_IO_NONALERT);
+ if (NT_SUCCESS (status2))
check_dir_not_empty (fh, pc);
else
{
fh = NULL;
debug_printf ("Opening dir %S for check_dir_not_empty failed, "
- "status = %p", pc.get_nt_native_path (), status);
+ "status = %p", pc.get_nt_native_path (), status2);
}
}
/* Trying to delete a hardlink to a file in use by the system in some