pthread.c's empth_select() returned 1 instead of 0 when empth_wakeup()
interrupted select(). This made io_input() attempt to read input,
which failed with WSAEWOULDBLOCK. The failure then got propagated all
the way up, and the player got logged out. Fix by returning 0 in that
case.
result = WSAWaitForMultipleEvents(2, hEventObject, FALSE, msec, FALSE);
switch (result) {
+ case WSA_WAIT_EVENT_0:
+ res = 1;
+ break;
+ case WSA_WAIT_EVENT_0 + 1:
case WSA_WAIT_TIMEOUT:
res = 0;
break;
res = -1;
break;
default:
- res = 1;
+ CANT_REACH();
+ errno = EINVAL;
+ res = -1;
}
WSAEventSelect(handle, hEventObject[0], 0);