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
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-09-11 18:43:09 +0400
committerChristopher Faylor <me@cgf.cx>2003-09-11 18:43:09 +0400
commit88092a3ea1325f08c41d71d4f8fab3176a9d5974 (patch)
treeaf07268cfb4a6a77696edcbbd6532f0315f3ecaa /winsup
parentd13d2a28ffb0b6aa3169b4facbcf20f49def50d5 (diff)
* dir.cc (rmdir): Add more samba workarounds.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/dir.cc9
2 files changed, 11 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index df7d2b2b2..28be890db 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,7 @@
+2003-09-11 Christopher Faylor <cgf@redhat.com>
+
+ * dir.cc (rmdir): Add more samba workarounds.
+
2003-09-11 Corinna Vinschen <corinna@vinschen.de>
* shared.cc (user_shared_initialize): Revert length attribute for name
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index 96ab1f282..a044f53f9 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -327,12 +327,17 @@ rmdir (const char *dir)
SetFileAttributes (real_dir,
(DWORD) real_dir & ~FILE_ATTRIBUTE_READONLY);
- if (RemoveDirectory (real_dir))
+ int rc = RemoveDirectory (real_dir);
+ DWORD att = GetFileAttributes (real_dir);
+
+ /* Sometimes smb indicates failure when it really succeeds, so check for
+ this case specifically. */
+ if (rc || att == INVALID_FILE_ATTRIBUTES)
{
/* RemoveDirectory on a samba drive doesn't return an error if the
directory can't be removed because it's not empty. Checking for
existence afterwards keeps us informed about success. */
- if (GetFileAttributes (real_dir) != INVALID_FILE_ATTRIBUTES)
+ if (att != INVALID_FILE_ATTRIBUTES)
set_errno (ENOTEMPTY);
else
res = 0;