Merge pull request #5835 from mattn/windows-errno

use WSAGetLastError() for errno on Windows
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-10-28 18:13:39 +09:00
committed by GitHub
+5
View File
@@ -1268,8 +1268,13 @@ mrb_io_s_select(mrb_state *mrb, mrb_value klass)
retry:
n = select(max, rp, wp, ep, tp);
if (n < 0) {
#ifdef _WIN32
if (WSAGetLastError() != WSAEINTR)
mrb_sys_fail(mrb, "select failed");
#else
if (errno != EINTR)
mrb_sys_fail(mrb, "select failed");
#endif
if (tp == NULL)
goto retry;
interrupt_flag = 1;