diff options
author | Christopher Faylor <me@cgf.cx> | 2001-08-28 20:38:07 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-08-28 20:38:07 +0000 |
commit | ffe94510f526c1f0115f5bb2c5e206303e45b216 (patch) | |
tree | 094315c720596c94d497445d582376b62b4b934d /winsup/cygwin/dir.cc | |
parent | 34971f0f8cff99825a130a47a329d96d67095edd (diff) | |
download | cygnal-ffe94510f526c1f0115f5bb2c5e206303e45b216.tar.gz cygnal-ffe94510f526c1f0115f5bb2c5e206303e45b216.tar.bz2 cygnal-ffe94510f526c1f0115f5bb2c5e206303e45b216.zip |
* 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.cc | 10 |
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; |