mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-23 07:09:53 +00:00
!7487 fix: unzip errcode 900002
Merge pull request !7487 from zhrenqiang/ziperr
This commit is contained in:
commit
9f1854d7ce
@ -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