Fix race condition in Linux version of Console.

develop
Petr Mrázek 2011-10-31 03:34:22 +01:00
parent 7f6fa2a008
commit 84e1a95205
1 changed files with 5 additions and 1 deletions

@ -145,8 +145,12 @@ namespace DFHack
{
while(1)
{
if (select(FD_SETSIZE, &descriptor_set, NULL, NULL, NULL) < 0)
while (select(FD_SETSIZE, &descriptor_set, NULL, NULL, NULL) < 0)
{
if(errno == EINTR)
continue;
return false;
}
if (FD_ISSET(STDIN_FILENO, &descriptor_set))
{
// read byte from stdin