summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/archive.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/archive.c b/src/archive.c
index e86a53a..07b33e2 100644
--- a/src/archive.c
+++ b/src/archive.c
@@ -105,12 +105,17 @@ static ssize_t tar_entry_read(void *stream, void *ptr, size_t size)
if (size > teis->bytes_left)
size = teis->bytes_left;
- if (size == 0)
- return 0;
+ if (size == 0)
+ return 0;
r = teis->tar_is->read(teis->tar_is, ptr, size);
- if (r < 0)
+ if (r <= 0) {
+ /* If inner stream returned zero (end-of-stream), we
+ * are getting short read, because tar header indicated
+ * more was to be expected. */
+ if (r == 0) return -ECONNABORTED;
return r;
+ }
teis->bytes_left -= r;
if (teis->csum == NULL)