Don't log out player when update aborts a command with pthreads
pthread.c's empth_select() returned -1 when empth_wakeup() interrupted select(). The failure then got propagated all the way up, and the player got logged out. Fix by returning 0 in that case. While there, retry on EINTR, to match LWP. Also clarify comments.
This commit is contained in:
parent
5073b022fd
commit
eea9e76bf8
3 changed files with 21 additions and 16 deletions
|
@ -110,11 +110,11 @@ io_close(struct iop *iop)
|
|||
}
|
||||
|
||||
/*
|
||||
* Return number of bytes read on success, zero on timeout or EOF, -1
|
||||
* on error, with errno set appropriately. In particular, return -1
|
||||
* with errno set to EAGAIN or EWOULDBLOCK when no data is available
|
||||
* for non-blocking input (WAITFORINPUT false). Use io_eof() to
|
||||
* distinguish timeout from EOF.
|
||||
* Return number of bytes read on success, zero on timeout, early
|
||||
* wakeup or EOF, -1 on error, with errno set appropriately. In
|
||||
* particular, return -1 with errno set to EAGAIN or EWOULDBLOCK when
|
||||
* no data is available for non-blocking input (WAITFORINPUT false).
|
||||
* Use io_eof() to distinguish timeout and early wakeup from EOF.
|
||||
*/
|
||||
int
|
||||
io_input(struct iop *iop, int waitforinput)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue