aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/ArchiveFileOperator.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-18 12:58:37 +0000
committersaturneric <[email protected]>2024-01-18 12:58:37 +0000
commite0d2c4021483e6e1366c1050ccb5a30e53e172bb (patch)
tree5d85739479622e7c672aea45f84d4e2f577f9332 /src/core/function/ArchiveFileOperator.cpp
parentfix: correct a fault (diff)
downloadGpgFrontend-e0d2c4021483e6e1366c1050ccb5a30e53e172bb.tar.gz
GpgFrontend-e0d2c4021483e6e1366c1050ccb5a30e53e172bb.zip
fix: add test cases and solve discovered issues
Diffstat (limited to 'src/core/function/ArchiveFileOperator.cpp')
-rw-r--r--src/core/function/ArchiveFileOperator.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/core/function/ArchiveFileOperator.cpp b/src/core/function/ArchiveFileOperator.cpp
index ef04d69f..54c78628 100644
--- a/src/core/function/ArchiveFileOperator.cpp
+++ b/src/core/function/ArchiveFileOperator.cpp
@@ -159,21 +159,10 @@ void ArchiveFileOperator::NewArchive2DataExchanger(
auto fd = open(archive_entry_sourcepath(entry), O_RDONLY);
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 ...", 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 ...", len);
- break;
- }
}
close(fd);
}