mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-27 01:11:15 +00:00
fix: unzip errcode 900002
Signed-off-by: zhrenqiang <zhangrenqiang@huawei.com> Change-Id: I7fba4c1c3618eb1a0a7cd8daaf5276ad0f8c96f1
This commit is contained in:
parent
235bd80f0a
commit
f31a213738
@ -244,6 +244,10 @@ ErrCode UnzipWithFilterAndWriters(const PlatformFile &srcFile, FilePath &destDir
|
||||
}
|
||||
} else {
|
||||
std::unique_ptr<WriterDelegate> writer = writerFactory(destDir, entryPath);
|
||||
if (!writer->PrepareOutput()) {
|
||||
APP_LOGE("PrepareOutput err");
|
||||
return ERR_ZLIB_DEST_FILE_DISABLED;
|
||||
}
|
||||
if (!reader.ExtractCurrentEntry(writer.get(), std::numeric_limits<uint64_t>::max())) {
|
||||
APP_LOGI("Failed to extract");
|
||||
return ERR_ZLIB_SRC_FILE_FORMAT_ERROR;
|
||||
|
@ -268,6 +268,10 @@ ErrCode UnzipWithFilterAndWriters(const PlatformFile &srcFile, FilePath &destDir
|
||||
}
|
||||
} else {
|
||||
std::unique_ptr<WriterDelegate> writer = writerFactory(destDir, entryPath);
|
||||
if (!writer->PrepareOutput()) {
|
||||
APP_LOGE("PrepareOutput err");
|
||||
return ERR_ZLIB_DEST_FILE_DISABLED;
|
||||
}
|
||||
if (!reader.ExtractCurrentEntry(writer.get(), std::numeric_limits<uint64_t>::max())) {
|
||||
APP_LOGI("Failed to extract");
|
||||
return ERR_ZLIB_SRC_FILE_FORMAT_ERROR;
|
||||
|
@ -191,9 +191,7 @@ bool ZipReader::ExtractCurrentEntry(WriterDelegate *delegate, uint64_t numBytesT
|
||||
}
|
||||
const int openResult = unzOpenCurrentFile(zipFile_);
|
||||
if (openResult != UNZ_OK) {
|
||||
return false;
|
||||
}
|
||||
if (!delegate->PrepareOutput()) {
|
||||
APP_LOGE("unzOpen err %{public}d", openResult);
|
||||
return false;
|
||||
}
|
||||
auto buf = std::make_unique<char[]>(kZipBufSize);
|
||||
|
Loading…
Reference in New Issue
Block a user