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>2010-09-11 14:58:42 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-09-11 14:58:42 +0400
commit99544f92a0d388f69c553e22265881ad3673d675 (patch)
tree87f8bbe27991d3e12b7ba5ceb466ba1e080cb3c9 /winsup/cygwin/fhandler_disk_file.cc
parent0f81b5d4bcaa5c840031796d94df9ba6d6fae4d0 (diff)
* fhandler_disk_file.cc (fhandler_disk_file::rmdir): More thoroughly
check the existence condition on remote drives. Enhance comment.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 1d7675c34..c7ecf48e8 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -1609,18 +1609,20 @@ fhandler_disk_file::rmdir ()
/* Check for existence of remote dirs after trying to delete them.
Two reasons:
- Sometimes SMB indicates failure when it really succeeds.
- - Removeing a directory on a samba drive doesn't return an error if the
- directory can't be removed because it's not empty. */
+ - Removing a directory on a Samba drive using an old Samba version
+ sometimes doesn't return an error, if the directory can't be removed
+ because it's not empty. */
if (isremote ())
{
OBJECT_ATTRIBUTES attr;
FILE_BASIC_INFORMATION fbi;
+ NTSTATUS q_status;
- if (NT_SUCCESS (NtQueryAttributesFile
- (pc.get_object_attr (attr, sec_none_nih), &fbi)))
- status = STATUS_DIRECTORY_NOT_EMPTY;
- else
+ q_status = NtQueryAttributesFile (pc.get_object_attr (attr, sec_none_nih), &fbi);
+ if (!NT_SUCCESS (status) && q_status == STATUS_OBJECT_NAME_NOT_FOUND)
status = STATUS_SUCCESS;
+ else if (NT_SUCCESS (status) && NT_SUCCESS (q_status))
+ status = STATUS_DIRECTORY_NOT_EMPTY;
}
if (!NT_SUCCESS (status))
{