diff options
| author | Petr Mrázek | 2011-10-31 03:34:22 +0100 |
|---|---|---|
| committer | Petr Mrázek | 2011-10-31 03:34:22 +0100 |
| commit | 84e1a952056d1996d61a02c927017039db948487 (patch) | |
| tree | 6c6684198f790189a112afc28fe8913a26b5f428 /library/Console-linux.cpp | |
| parent | 7f6fa2a0089b772671f73b22eb07525a9e60a6d5 (diff) | |
| download | dfhack-84e1a952056d1996d61a02c927017039db948487.tar.gz dfhack-84e1a952056d1996d61a02c927017039db948487.tar.bz2 dfhack-84e1a952056d1996d61a02c927017039db948487.tar.xz | |
Fix race condition in Linux version of Console.
Diffstat (limited to 'library/Console-linux.cpp')
| -rw-r--r-- | library/Console-linux.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/library/Console-linux.cpp b/library/Console-linux.cpp index ab3a147a..083d4197 100644 --- a/library/Console-linux.cpp +++ b/library/Console-linux.cpp @@ -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 |
