Gracefully ignore read() yielding EINTR rather than bailing out

This commit is contained in:
Paul LeoNerd Evans 2011-05-24 18:17:15 +01:00
parent dad0e5019c
commit ac14d7b504
1 changed files with 1 additions and 1 deletions

View File

@ -873,7 +873,7 @@ TermKeyResult termkey_advisereadable(TermKey *tk)
unsigned char buffer[64]; // Smaller than the default size unsigned char buffer[64]; // Smaller than the default size
ssize_t len = read(tk->fd, buffer, sizeof buffer); ssize_t len = read(tk->fd, buffer, sizeof buffer);
if(len == -1 && errno == EAGAIN) if(len == -1 && (errno == EAGAIN || errno == EINTR))
return TERMKEY_RES_NONE; return TERMKEY_RES_NONE;
else if(len < 1) { else if(len < 1) {
tk->is_closed = 1; tk->is_closed = 1;