mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-22 00:38:06 +08:00
* syscalls.cc (rename): Fix setting errno in case of trailing "/."
This commit is contained in:
parent
e21ac1ebdb
commit
124d4c5010
@ -1,3 +1,7 @@
|
|||||||
|
2008-03-27 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* syscalls.cc (rename): Fix setting errno in case of trailing "/."
|
||||||
|
|
||||||
2008-03-27 Corinna Vinschen <corinna@vinschen.de>
|
2008-03-27 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler_socket.cc: Create shared objects session local throughout.
|
* fhandler_socket.cc: Create shared objects session local throughout.
|
||||||
|
@ -1497,10 +1497,16 @@ rename (const char *oldpath, const char *newpath)
|
|||||||
if (efault.faulted (EFAULT))
|
if (efault.faulted (EFAULT))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (has_dot_last_component (oldpath, true)
|
if (has_dot_last_component (oldpath, true))
|
||||||
|| has_dot_last_component (newpath, true))
|
|
||||||
{
|
{
|
||||||
set_errno (EINVAL);
|
oldpc.check (oldpath, PC_SYM_NOFOLLOW, stat_suffixes);
|
||||||
|
set_errno (oldpc.isdir () ? EBUSY : ENOTDIR);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
if (has_dot_last_component (newpath, true))
|
||||||
|
{
|
||||||
|
newpc.check (newpath, PC_SYM_NOFOLLOW, stat_suffixes);
|
||||||
|
set_errno (!newpc.exists () ? ENOENT : newpc.isdir () ? EBUSY : ENOTDIR);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user