diff options
author | Karel Zak | 2015-06-30 16:05:03 +0200 |
---|---|---|
committer | Karel Zak | 2015-07-20 11:48:09 +0200 |
commit | 1e0cd7ae9e561f725a52f6a2607c1e2cc7e82df3 (patch) | |
tree | 0fc1d6559baff2653a5e2c2c0e7d38379a2204fa /include/all-io.h | |
parent | lsipc: add CTIME to shmem default (diff) | |
download | kernel-qcow2-util-linux-1e0cd7ae9e561f725a52f6a2607c1e2cc7e82df3.tar.gz kernel-qcow2-util-linux-1e0cd7ae9e561f725a52f6a2607c1e2cc7e82df3.tar.xz kernel-qcow2-util-linux-1e0cd7ae9e561f725a52f6a2607c1e2cc7e82df3.zip |
include/all-io: read_all() don't retry on EOF
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/all-io.h')
-rw-r--r-- | include/all-io.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/all-io.h b/include/all-io.h index 2546cff1b..0623692e1 100644 --- a/include/all-io.h +++ b/include/all-io.h @@ -64,8 +64,7 @@ static inline ssize_t read_all(int fd, char *buf, size_t count) while (count > 0) { ret = read(fd, buf, count); if (ret <= 0) { - if ((errno == EAGAIN || errno == EINTR || ret == 0) && - (tries++ < 5)) { + if (ret < 0 && (errno == EAGAIN || errno == EINTR) && (tries++ < 5)) { xusleep(250000); continue; } @@ -80,5 +79,4 @@ static inline ssize_t read_all(int fd, char *buf, size_t count) return c; } - #endif /* UTIL_LINUX_ALL_IO_H */ |