Don't log out player when update aborts a command under Windows
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.
This commit is contained in:
parent
ee01ac1912
commit
2bfe7a1198
1 changed files with 7 additions and 1 deletions
|
@ -568,6 +568,10 @@ empth_select(int fd, int flags, struct timeval *timeout)
|
|||
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;
|
||||
|
@ -576,7 +580,9 @@ empth_select(int fd, int flags, struct timeval *timeout)
|
|||
res = -1;
|
||||
break;
|
||||
default:
|
||||
res = 1;
|
||||
CANT_REACH();
|
||||
errno = EINVAL;
|
||||
res = -1;
|
||||
}
|
||||
|
||||
WSAEventSelect(handle, hEventObject[0], 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue