summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-05 23:14:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-05 23:14:25 +0000
commit649016bdb1d744a79e50e23c9483ee16c55a24ab (patch)
tree1c5425f053dae87526636ac545b30faf74426209 /win32/win32.c
parent5e57dc0fae0f6d9ec04c770337da1792268a71f1 (diff)
win32.c: suppress a warning
* win32/win32.c (get_attr_vsn): assume GetLastError() never return 0, to suppress a maybe-uninitialized warning in wrename(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index dfdd1e1..2a58876 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4981,9 +4981,12 @@ get_attr_vsn(const WCHAR *path, DWORD *atts, DWORD *vsn)
DWORD e = 0;
HANDLE h = open_special(path, 0, FILE_FLAG_OPEN_REPARSE_POINT);
- if (h == INVALID_HANDLE_VALUE) return GetLastError();
+ if (h == INVALID_HANDLE_VALUE) {
+ ASSUME(e = GetLastError());
+ return e;
+ }
if (!GetFileInformationByHandle(h, &st)) {
- e = GetLastError();
+ ASSUME(e = GetLastError());
}
else {
*atts = st.dwFileAttributes;