mirror of
https://gitee.com/openharmony/bundlemanager_bundle_framework
synced 2024-11-23 07:09:53 +00:00
commit
0962dcd244
@ -322,6 +322,7 @@ private:
|
||||
static EnforceMetadataProcessForApp enforceMetadataProcessForApp_;
|
||||
static bool OpenEncryptionHandle();
|
||||
#endif
|
||||
static void FsyncResFile(const std::string &path, const ExtractFileType &extractFileType);
|
||||
};
|
||||
} // namespace AppExecFwk
|
||||
} // namespace OHOS
|
||||
|
@ -539,9 +539,25 @@ void InstalldOperator::ExtractTargetFile(const BundleExtractor &extractor, const
|
||||
LOG_E(BMS_TAG_INSTALLD, "ChangeModeFile %{public}s failed, errno: %{public}d", path.c_str(), errno);
|
||||
return;
|
||||
}
|
||||
FsyncResFile(path, extractFileType);
|
||||
LOG_D(BMS_TAG_INSTALLD, "extract file success, path : %{public}s", path.c_str());
|
||||
}
|
||||
|
||||
void InstalldOperator::FsyncResFile(const std::string &path, const ExtractFileType &extractFileType)
|
||||
{
|
||||
if (extractFileType == ExtractFileType::RES_FILE) {
|
||||
int32_t fileFd = open(path.c_str(), O_RDONLY);
|
||||
if (fileFd < 0) {
|
||||
LOG_E(BMS_TAG_INSTALLER, "open %{public}s failed", path.c_str());
|
||||
return;
|
||||
}
|
||||
if (fsync(fileFd) != 0) {
|
||||
LOG_E(BMS_TAG_INSTALLER, "fsync %{public}s failed", path.c_str());
|
||||
}
|
||||
close(fileFd);
|
||||
}
|
||||
}
|
||||
|
||||
bool InstalldOperator::DeterminePrefix(const ExtractFileType &extractFileType, const std::string &cpuAbi,
|
||||
std::string &prefix)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user