errno must be set before mrb_sys_fail

This commit is contained in:
Yasuhiro Matsumoto
2022-10-30 01:00:27 +09:00
parent 15eb62479b
commit 4612c8b2d6
+2 -1
View File
@@ -1269,7 +1269,8 @@ retry:
n = select(max, rp, wp, ep, tp);
if (n < 0) {
#ifdef _WIN32
if (WSAGetLastError() != WSAEINTR)
errno = WSAGetLastError();
if (errno != WSAEINTR)
mrb_sys_fail(mrb, "select failed");
#else
if (errno != EINTR)