Skip to content

Commit

Permalink
read as much as possible in emacs_intr_read
Browse files Browse the repository at this point in the history
  • Loading branch information
geza-herman committed Mar 22, 2022
1 parent bd5d136 commit 784a9fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/sysdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -2523,6 +2523,15 @@ emacs_intr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible)
}
while (result < 0 && errno == EINTR);

if (result > 0) {
for (;;) {
ssize_t r = read(fd, buf + result, nbyte - result);
if (r <= 0) break;
if (interruptible) maybe_quit ();
result += r;
}
}

return result;
}

Expand Down

0 comments on commit 784a9fd

Please sign in to comment.