fix busy loop when client exits
git-svn-id: http://svn.code.sf.net/p/xqf/code/trunk@815 d2ac09be-c843-0410-8b1f-f8a84130e0ec
This commit is contained in:
parent
e9b80895ce
commit
a5b2b849b7
@ -1,3 +1,6 @@
|
||||
Jan 11, 2008: Ludwig Nussel <@users.sourceforge.net>
|
||||
- fix busy loop when client exits
|
||||
|
||||
Nov 04, 2007: Ludwig Nussel <l-n@users.sourceforge.net>
|
||||
- close fds before launching games
|
||||
|
||||
|
@ -168,10 +168,13 @@ static void client_input_callback (struct running_client *cl, int fd,
|
||||
|
||||
res = read (fd, cl->buffer + cl->pos, CLIENT_ERROR_BUFFER - 1 - cl->pos);
|
||||
|
||||
if (res <= 0) { /* read error or EOF */
|
||||
if (res < 0) { /* read error or EOF */
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
return;
|
||||
|
||||
client_detach (cl);
|
||||
return;
|
||||
} else if (res == 0) {
|
||||
client_detach (cl);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user