summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 55415b631..7a4f239b8 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1758,6 +1758,16 @@ rename (const char *oldpath, const char *newpath)
set_errno (EROFS);
goto out;
}
+ if (oldpc.has_attribute (FILE_ATTRIBUTE_REPARSE_POINT) && !oldpc.issymlink ())
+ {
+ /* Volume mount point. If we try to rename a volume mount point, NT
+ returns STATUS_NOT_SAME_DEVICE ==> Win32 ERROR_NOT_SAME_DEVICE ==>
+ errno EXDEV. That's bad since mv(1) will now perform a cross-device
+ move. So what we do here is to treat the volume mount point just
+ like Linux treats a mount point. */
+ set_errno (EBUSY);
+ goto out;
+ }
if (old_dir_requested && !oldpc.isdir ())
{
/* Reject rename("file/","x"). */