From ac14d7b504e0e1d34c794df521c3f0d36d1898a3 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Tue, 24 May 2011 18:17:15 +0100 Subject: Gracefully ignore read() yielding EINTR rather than bailing out --- termkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/termkey.c b/termkey.c index c95dbf4..59b1859 100644 --- a/termkey.c +++ b/termkey.c @@ -873,7 +873,7 @@ TermKeyResult termkey_advisereadable(TermKey *tk) unsigned char buffer[64]; // Smaller than the default size 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; else if(len < 1) { tk->is_closed = 1; -- cgit v1.2.3-70-g09d2