OSDN Git Service

Patch by Kazuhiro Fujieda <fujieda@jaist.ac.jp>:
authorcorinna <corinna>
Thu, 25 May 2000 10:27:36 +0000 (10:27 +0000)
committercorinna <corinna>
Thu, 25 May 2000 10:27:36 +0000 (10:27 +0000)
        * dir.cc (rmdir): Correct the manner in checking the target directory.

winsup/cygwin/ChangeLog
winsup/cygwin/dir.cc

index cb0156d..1b4d008 100644 (file)
@@ -1,3 +1,7 @@
+2000-05-25  Kazuhiro Fujieda <fujieda@jaist.ac.jp>
+
+       * dir.cc (rmdir): Correct the manner in checking the target directory.
+
 Wed May 24 21:59:00 2000  Corinna Vinschen <corinna@vinschen.de>
 
        * dir.cc (writable_directory): Comment out previous code,
index 741be84..dc70ae1 100644 (file)
@@ -341,7 +341,8 @@ 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. */
-     if (GetFileAttributes (real_dir.get_win32()) != FILE_ATTRIBUTE_DIRECTORY)
+     int attr = GetFileAttributes (real_dir.get_win32());
+     if (attr != -1 && !(attr & FILE_ATTRIBUTE_DIRECTORY))
        set_errno (ENOTDIR);
      else if (os_being_run != winNT)
        set_errno (ENOTEMPTY);