Ignore EAGAIN when doing tty io

This commit is contained in:
Kovid Goyal 2022-08-02 17:21:28 +05:30
parent 3463931dad
commit 609d42e2bc
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -484,6 +484,7 @@ read_from_tty(int *fd, transfer_buf *t) {
ssize_t n = safe_read(*fd, t->buf + t->sz, IO_BUZ_SZ - t->sz);
if (n < 0) {
if (errno == EPIPE || errno == EIO) { *fd = -1; return true; }
if (errno == EAGAIN) return true;
return false;
}
if (n == 0) *fd = -1; // hangup