mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* win32/win32.c (wunlink): reverted a part of r32426. it was mistakenly
mixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c3e0526269
commit
fc22563658
2 changed files with 6 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Jul 8 14:40:39 2011 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.c (wunlink): reverted a part of r32426. it was mistakenly
|
||||||
|
mixed.
|
||||||
|
|
||||||
Fri Jul 8 14:29:47 2011 Narihiro Nakamura <authornari@gmail.com>
|
Fri Jul 8 14:29:47 2011 Narihiro Nakamura <authornari@gmail.com>
|
||||||
|
|
||||||
* configure.in: can't subtract void *.
|
* configure.in: can't subtract void *.
|
||||||
|
|
|
@ -5642,18 +5642,13 @@ wunlink(const WCHAR *path)
|
||||||
if (attr != (DWORD)-1 && (attr & FILE_ATTRIBUTE_READONLY)) {
|
if (attr != (DWORD)-1 && (attr & FILE_ATTRIBUTE_READONLY)) {
|
||||||
SetFileAttributesW(path, attr & ~FILE_ATTRIBUTE_READONLY);
|
SetFileAttributesW(path, attr & ~FILE_ATTRIBUTE_READONLY);
|
||||||
}
|
}
|
||||||
if (DeleteFileW(path) == FALSE) {
|
if (!DeleteFileW(path)) {
|
||||||
errno = map_errno(GetLastError());
|
errno = map_errno(GetLastError());
|
||||||
ret = -1;
|
ret = -1;
|
||||||
if (attr != (DWORD)-1 && (attr & FILE_ATTRIBUTE_READONLY)) {
|
if (attr != (DWORD)-1 && (attr & FILE_ATTRIBUTE_READONLY)) {
|
||||||
SetFileAttributesW(path, attr);
|
SetFileAttributesW(path, attr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
while (GetFileAttributesW(path) != (DWORD)-1 || GetLastError() != ERROR_FILE_NOT_FOUND) {
|
|
||||||
Sleep(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue