diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2011-10-24 14:02:32 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2011-10-24 14:02:32 +0000 |
commit | 53e93974c8b3f68a5b6b657c8aff9462d62a24cd (patch) | |
tree | 38f3e940fc50458dcc6a6e74f4c4b58c6e563700 | |
parent | b3480fbefbcf44d95dbf47d3e25e1eb6e1bb725a (diff) | |
download | cygnal-53e93974c8b3f68a5b6b657c8aff9462d62a24cd.tar.gz cygnal-53e93974c8b3f68a5b6b657c8aff9462d62a24cd.tar.bz2 cygnal-53e93974c8b3f68a5b6b657c8aff9462d62a24cd.zip |
* 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.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 14 |
2 files changed, 14 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 9153680cc..20bb859e2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,11 @@ 2011-10-24 Corinna Vinschen <corinna@vinschen.de> + * 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. + +2011-10-24 Corinna Vinschen <corinna@vinschen.de> + * shared.cc (open_shared): Fix memory reservation of essential shared memory regions. Drop delta computations since delta is always 0 in non-relocated case. Add a comment. 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 |