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
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-02-04 22:02:42 +0300
committerChristopher Faylor <me@cgf.cx>2006-02-04 22:02:42 +0300
commit25bafd7b0e256c128c9bbbcfa5342f9d84ff08e3 (patch)
tree4e846e27775433fc6523c2492d1690f137d9170a /winsup/cygwin/dir.cc
parent324ce34bd5924ecac453a5ae20c975b675785c4c (diff)
* dir.cc (rmdir): Reorganize check for trailing dot to return correct error
when directory does not exist.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r--winsup/cygwin/dir.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index 0caf2df3a..eb357cd02 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -295,12 +295,6 @@ rmdir (const char *dir)
if (efault.faulted (EFAULT))
return -1;
- if (has_dot_last_component (dir))
- {
- set_errno (EINVAL);
- return -1;
- }
-
if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW)))
goto done; /* errno already set */;
@@ -309,8 +303,11 @@ 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))
+ set_errno (fh->exists () ? EINVAL : ENOENT);
else if (!fh->rmdir ())
res = 0;
+
delete fh;
done: