diff options
-rw-r--r-- | lib/safe-read.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/safe-read.c b/lib/safe-read.c index c189eb1a6..75ac7bf31 100644 --- a/lib/safe-read.c +++ b/lib/safe-read.c @@ -78,6 +78,8 @@ safe_read (int fd, void *buf, size_t count) nbytes_to_read = MAX_BYTES_TO_READ & ~8191; result = read (fd, ptr, nbytes_to_read); + if (result == 0) + break; if (result < 0) { #ifdef EINTR |