summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/util/os_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/os_file.c b/src/util/os_file.c
index 246fd32fdf6..da17d12b50e 100644
--- a/src/util/os_file.c
+++ b/src/util/os_file.c
@@ -29,8 +29,10 @@ readN(int fd, char *buf, size_t len)
if (ret == -EINTR || ret == -EAGAIN)
continue;
- if (ret <= 0)
+ if (ret <= 0) {
+ err = ret;
break;
+ }
total += ret;
} while (total != len);