diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-03-27 13:02:07 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-03-27 13:02:07 +0000 |
commit | 124d4c50103e42048dd76d0ab549de6bc216413b (patch) | |
tree | c82002aaf67751043dfeaefd34a2749e5f08abcb | |
parent | e21ac1ebdba953f1a88d5630b9868a7a780eb144 (diff) | |
download | cygnal-124d4c50103e42048dd76d0ab549de6bc216413b.tar.gz cygnal-124d4c50103e42048dd76d0ab549de6bc216413b.tar.bz2 cygnal-124d4c50103e42048dd76d0ab549de6bc216413b.zip |
* syscalls.cc (rename): Fix setting errno in case of trailing "/."
-rw-r--r-- | winsup/cygwin/ChangeLog | 4 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 624acd316..57292c634 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,9 @@ 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> + * fhandler_socket.cc: Create shared objects session local throughout. * shared.cc (shared_name): Add argument to allow opening session local shared memory. diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index d5f468344..eb3993d3d 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1497,10 +1497,16 @@ rename (const char *oldpath, const char *newpath) if (efault.faulted (EFAULT)) return -1; - if (has_dot_last_component (oldpath, true) - || has_dot_last_component (newpath, true)) + if (has_dot_last_component (oldpath, 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; } |