* dir.cc (rmdir): Move existance check in front of

has_dot_last_component check.  Simply setting errno in latter case.
This commit is contained in:
Corinna Vinschen 2007-02-22 16:32:39 +00:00
parent e9095199cc
commit 03d5ce6d08
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
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.

View 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;