summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 06:53:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 06:53:32 +0000
commitdd67521bd1a1c98b2591f2a5b8bca32bc1ff1705 (patch)
tree75ca3fd0a6c919d799676cf203cdee78db7f4b73
parent597da7b2d0720fc0dd4f8980c628320bd4e26f37 (diff)
win32.c: ELOOP by _wopen
* win32/win32.c (rb_w32_wopen): map the exact error for ELOOP when EINVAL is returned by _wopen of vc runtime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--win32/win32.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 84b574ff3c..a9598e1a94 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -5970,7 +5970,16 @@ rb_w32_wopen(const WCHAR *file, int oflag, ...)
pmode = va_arg(arg, int);
va_end(arg);
fd = _wopen(file, oflag, pmode);
- if (fd == -1 && errno == EACCES) check_if_wdir(file);
+ if (fd == -1) {
+ switch (errno) {
+ case EACCES:
+ check_if_wdir(file);
+ break;
+ case EINVAL:
+ errno = map_errno(GetLastError());
+ break;
+ }
+ }
return fd;
}