* dir.cc (rmdir): Use file attributes that have already been discovered by

path_conv.
This commit is contained in:
Christopher Faylor 2000-05-25 19:48:45 +00:00
parent 382541f2f2
commit e3df22607a
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Thu May 25 13:29:23 2000 Christopher Faylor <cgf@cygnus.com>
* dir.cc (rmdir): Use file attributes that have already been discovered
by path_conv.
2000-05-25 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* dir.cc (rmdir): Correct the manner in checking the target directory.

View File

@ -341,8 +341,7 @@ rmdir (const char *dir)
/* Under Windows 9X or on a samba share, ERROR_ACCESS_DENIED is
returned if you try to remove a file. On 9X the same error is
returned if you try to remove a non-empty directory. */
int attr = GetFileAttributes (real_dir.get_win32());
if (attr != -1 && !(attr & FILE_ATTRIBUTE_DIRECTORY))
if (real_dir.fileattr != (DWORD) -1 && !(real_dir.fileattr & FILE_ATTRIBUTE_DIRECTORY))
set_errno (ENOTDIR);
else if (os_being_run != winNT)
set_errno (ENOTEMPTY);