OSDN Git Service

* dir.cc (rmdir): Move existance check in front of
authorcorinna <corinna>
Thu, 22 Feb 2007 16:32:39 +0000 (16:32 +0000)
committercorinna <corinna>
Thu, 22 Feb 2007 16:32:39 +0000 (16:32 +0000)
has_dot_last_component check.  Simply setting errno in latter case.

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

index 8a00284..aa11209 100644 (file)
@@ -1,5 +1,10 @@
 2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
 
+       * dir.cc (rmdir): Move existance check in front of
+       has_dot_last_component check.  Simply setting errno in latter case.
+
+2007-02-22  Corinna Vinschen  <corinna@vinschen.de>
+
        * fhandler.cc (fhandler_base::write): Remove wincap.has_lseek_bug case.
        Simplify seek beyond EOF case.
        * times.cc (times): Remove wincap.has_get_process_times case.
index 63467b7..3d0dbae 100644 (file)
@@ -307,10 +307,10 @@ rmdir (const char *dir)
       debug_printf ("got %d error from build_fh_name", fh->error ());
       set_errno (fh->error ());
     }
-  else if (has_dot_last_component (dir, false))
-    set_errno (fh->exists () ? EINVAL : ENOENT);
   else if (!fh->exists ())
     set_errno (ENOENT);
+  else if (has_dot_last_component (dir, false))
+    set_errno (EINVAL);
   else if (!fh->rmdir ())
     res = 0;