summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 16:22:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 16:22:56 +0000
commit8504c817e3a1513c428b4dad0f3e3943e5aba0a3 (patch)
tree1d5ae2e74dce1edc7787f495bbc89d3e2e18ddf1 /win32/win32.c
parent74842faf64da62deac21ff07d5e0b3882c097e22 (diff)
win32.c: ELOOP at wrename
* win32/win32.c (wrename): fail with ELOOP if failed to resolve the old path name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 8d1a100..c9d3522 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -5009,6 +5009,18 @@ wrename(const WCHAR *oldpath, const WCHAR *newpath)
errno = map_errno(GetLastError());
return -1;
}
+ if (oldatts & FILE_ATTRIBUTE_REPARSE_POINT) {
+ HANDLE fh = CreateFileW(oldpath, 0, 0, NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (fh == INVALID_HANDLE_VALUE) {
+ int e = GetLastError();
+ if (e == ERROR_CANT_RESOLVE_FILENAME) {
+ errno = ELOOP;
+ return -1;
+ }
+ }
+ CloseHandle(fh);
+ }
RUBY_CRITICAL({
if (newatts != -1 && newatts & FILE_ATTRIBUTE_READONLY)