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>2001-08-29 00:38:07 +0400
committerChristopher Faylor <me@cgf.cx>2001-08-29 00:38:07 +0400
commitffe94510f526c1f0115f5bb2c5e206303e45b216 (patch)
tree094315c720596c94d497445d582376b62b4b934d /winsup/cygwin/dir.cc
parent34971f0f8cff99825a130a47a329d96d67095edd (diff)
* dir.cc (rmdir): Report ENOENT when file doesn't exist rather than ENOTDIR.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r--winsup/cygwin/dir.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc
index e9628b377..83e38deb5 100644
--- a/winsup/cygwin/dir.cc
+++ b/winsup/cygwin/dir.cc
@@ -352,9 +352,15 @@ rmdir (const char *dir)
goto done;
}
+ /* Does the file exist? */
+ if (real_dir.file_attributes () == (DWORD) -1)
+ {
+ set_errno (ENOENT);
+ goto done;
+ }
+
/* Is `dir' a directory? */
- if (real_dir.file_attributes () == (DWORD) -1 ||
- !(real_dir.file_attributes () & FILE_ATTRIBUTE_DIRECTORY))
+ if (!(real_dir.file_attributes () & FILE_ATTRIBUTE_DIRECTORY))
{
set_errno (ENOTDIR);
goto done;