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:
Ludwig Nussel 2008-01-15 21:20:30 +00:00 committed by l-n
parent e9b80895ce
commit a5b2b849b7
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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;
}