ruby-changes:39616
From: nobu <ko1@a...>
Date: Thu, 27 Aug 2015 01:23:17 +0900 (JST)
Subject: [ruby-changes:39616] nobu:r51697 (trunk): win32.c: ELOOP at wrename
nobu 2015-08-27 01:22:56 +0900 (Thu, 27 Aug 2015) New Revision: 51697 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51697 Log: win32.c: ELOOP at wrename * win32/win32.c (wrename): fail with ELOOP if failed to resolve the old path name. Modified files: trunk/win32/win32.c Index: win32/win32.c =================================================================== --- win32/win32.c (revision 51696) +++ win32/win32.c (revision 51697) @@ -5009,6 +5009,18 @@ wrename(const WCHAR *oldpath, const WCHA https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L5009 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/