ruby-changes:48958
From: nobu <ko1@a...>
Date: Fri, 8 Dec 2017 15:20:15 +0900 (JST)
Subject: [ruby-changes:48958] nobu:r61077 (trunk): win32.c: check error code
nobu 2017-12-08 15:20:06 +0900 (Fri, 08 Dec 2017) New Revision: 61077 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61077 Log: win32.c: check error code * win32/win32.c (w32_io_info): check GetFileInformationByHandleEx error code to fallback to GetFileInformationByHandle. Modified files: trunk/win32/win32.c Index: win32/win32.c =================================================================== --- win32/win32.c (revision 61076) +++ win32/win32.c (revision 61077) @@ -8050,7 +8050,12 @@ w32_io_info(VALUE *file, w32_io_info_t * https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L8050 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/