* 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:
parent
1912201029
commit
324ce34bd5
|
@ -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>
|
2006-02-03 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* path.cc (suffix_scan::lnk_match): Return true beginning with
|
* path.cc (suffix_scan::lnk_match): Return true beginning with
|
||||||
|
|
|
@ -265,12 +265,6 @@ mkdir (const char *dir, mode_t mode)
|
||||||
if (efault.faulted (EFAULT))
|
if (efault.faulted (EFAULT))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (has_dot_last_component (dir))
|
|
||||||
{
|
|
||||||
set_errno (ENOENT);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW)))
|
if (!(fh = build_fh_name (dir, NULL, PC_SYM_NOFOLLOW)))
|
||||||
goto done; /* errno already set */;
|
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 ());
|
debug_printf ("got %d error from build_fh_name", fh->error ());
|
||||||
set_errno (fh->error ());
|
set_errno (fh->error ());
|
||||||
}
|
}
|
||||||
|
else if (has_dot_last_component (dir))
|
||||||
|
set_errno (fh->exists () ? EEXIST : ENOENT);
|
||||||
else if (!fh->mkdir (mode))
|
else if (!fh->mkdir (mode))
|
||||||
res = 0;
|
res = 0;
|
||||||
delete fh;
|
delete fh;
|
||||||
|
|
|
@ -1257,8 +1257,6 @@ fhandler_disk_file::mkdir (mode_t mode)
|
||||||
#endif
|
#endif
|
||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
else if (pc.exists ())
|
|
||||||
set_errno (EEXIST);
|
|
||||||
else
|
else
|
||||||
__seterrno ();
|
__seterrno ();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue