aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/function/ArchiveFileOperator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/function/ArchiveFileOperator.cpp b/src/core/function/ArchiveFileOperator.cpp
index aad8b525..ef04d69f 100644
--- a/src/core/function/ArchiveFileOperator.cpp
+++ b/src/core/function/ArchiveFileOperator.cpp
@@ -160,19 +160,18 @@ void ArchiveFileOperator::NewArchive2DataExchanger(
auto len = read(fd, buff.data(), buff.size());
assert(len <= buff.size() && len > 0);
if (len == -1) {
- GF_CORE_LOG_ERROR("read() failed, ret: {}, abort ...", r);
+ GF_CORE_LOG_ERROR("read() failed, ret: {}, abort ...", len);
archive_entry_free(entry);
close(fd);
break;
}
+
while (len > 0) {
archive_write_data(archive, buff.data(), len);
len = read(fd, buff.data(), buff.size());
assert(len <= buff.size() && len > 0);
if (len == -1) {
- GF_CORE_LOG_ERROR("read() failed, ret: {}, abort ...", r);
- archive_entry_free(entry);
- close(fd);
+ GF_CORE_LOG_ERROR("read() failed, ret: {}, abort ...", len);
break;
}
}