diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-02-22 16:32:39 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-02-22 16:32:39 +0000 |
commit | 03d5ce6d087057ba45f913fa7be12a646a204b99 (patch) | |
tree | 4cb361f496762be10a997a5f58bc574a2d22a8a8 /winsup/cygwin/dir.cc | |
parent | e9095199cc90f0d01e4ec8cb270c81a0ef3dfd74 (diff) | |
download | cygnal-03d5ce6d087057ba45f913fa7be12a646a204b99.tar.gz cygnal-03d5ce6d087057ba45f913fa7be12a646a204b99.tar.bz2 cygnal-03d5ce6d087057ba45f913fa7be12a646a204b99.zip |
* dir.cc (rmdir): Move existance check in front of
has_dot_last_component check. Simply setting errno in latter case.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r-- | winsup/cygwin/dir.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index 63467b7fb..3d0dbae7b 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -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; |