* dir.cc (mkdir): Reorganize check for trailing dot to return correct error

when directory exists.
* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Remove special test for
path ending in '.'.
This commit is contained in:
Christopher Faylor 2006-02-04 04:31:34 +00:00
parent 1912201029
commit 324ce34bd5
3 changed files with 9 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2006-02-03 Christopher Faylor <cgf@timesys.com>
* dir.cc (mkdir): Reorganize check for trailing dot to return correct
error when directory exists.
* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Remove special
test for path ending in '.'.
2006-02-03 Corinna Vinschen <corinna@vinschen.de>
* path.cc (suffix_scan::lnk_match): Return true beginning with

View File

@ -265,12 +265,6 @@ mkdir (const char *dir, mode_t mode)
if (efault.faulted (EFAULT))
return -1;
if (has_dot_last_component (dir))
{
set_errno (ENOENT);
return -1;
}
if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW)))
goto done; /* errno already set */;
@ -279,6 +273,8 @@ mkdir (const char *dir, mode_t mode)
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 () ? EEXIST : ENOENT);
else if (!fh->mkdir (mode))
res = 0;
delete fh;

View File

@ -1257,8 +1257,6 @@ fhandler_disk_file::mkdir (mode_t mode)
#endif
res = 0;
}
else if (pc.exists ())
set_errno (EEXIST);
else
__seterrno ();