mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-03-03 13:35:46 +08:00
* dir.cc (rmdir): Add more samba workarounds.
This commit is contained in:
parent
d13d2a28ff
commit
88092a3ea1
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user