diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-09-11 10:58:42 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-09-11 10:58:42 +0000 |
commit | 99544f92a0d388f69c553e22265881ad3673d675 (patch) | |
tree | 87f8bbe27991d3e12b7ba5ceb466ba1e080cb3c9 | |
parent | 0f81b5d4bcaa5c840031796d94df9ba6d6fae4d0 (diff) | |
download | newlib-99544f92a0d388f69c553e22265881ad3673d675.zip newlib-99544f92a0d388f69c553e22265881ad3673d675.tar.gz newlib-99544f92a0d388f69c553e22265881ad3673d675.tar.bz2 |
* fhandler_disk_file.cc (fhandler_disk_file::rmdir): More thoroughly
check the existence condition on remote drives. Enhance comment.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 18b92a7..848b71f 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2010-09-11 Corinna Vinschen <corinna@vinschen.de> + + * fhandler_disk_file.cc (fhandler_disk_file::rmdir): More thoroughly + check the existence condition on remote drives. Enhance comment. + 2010-09-11 Dave Korn <dave.korn.cygwin@gmail.com> * Makefile.in (DLL_OFILES): Add new fenv.o module. diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 1d7675c..c7ecf48 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)) { |