diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-08 06:20:06 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-08 06:20:06 +0000 |
commit | 23c86d84e6816c91addb3781d4f8524021a1571b (patch) | |
tree | 6eab3dbc6b92604ab67499461642f28aa9c6195e | |
parent | a4804fbdf503a9c2b550b877120ca4029c65cdb3 (diff) | |
download | ruby-23c86d84e6816c91addb3781d4f8524021a1571b.tar.gz |
win32.c: check error code
* win32/win32.c (w32_io_info): check GetFileInformationByHandleEx
error code to fallback to GetFileInformationByHandle.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | win32/win32.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c index 0c71f1263b..599225bbdd 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -8050,7 +8050,12 @@ w32_io_info(VALUE *file, w32_io_info_t *st) st->file_id_p = TRUE; return ret; } - /* may not work at files on network drives, fallback to old API. */ + else if (GetLastError() != ERROR_INVALID_PARAMETER) { + CloseHandle(f); + return FALSE; + } + /* this API may not wrok at files on non Microsoft SMB + * server, fallback to old API then. */ } if (GetFileInformationByHandle(f, &st->info.bhfi)) { st->file_id_p = FALSE; |