diff --git a/services/bundlemgr_lite/bundle_daemon/src/bundle_file_utils.cpp b/services/bundlemgr_lite/bundle_daemon/src/bundle_file_utils.cpp index 8c7d2d5..6422d04 100644 --- a/services/bundlemgr_lite/bundle_daemon/src/bundle_file_utils.cpp +++ b/services/bundlemgr_lite/bundle_daemon/src/bundle_file_utils.cpp @@ -142,6 +142,7 @@ bool BundleFileUtils::WriteFile(const char *file, const void *buffer, uint32_t s return false; } + fsync(fp); close(fp); return true; } diff --git a/services/bundlemgr_lite/src/extractor_util.cpp b/services/bundlemgr_lite/src/extractor_util.cpp index 4ac98cb..935f9a6 100755 --- a/services/bundlemgr_lite/src/extractor_util.cpp +++ b/services/bundlemgr_lite/src/extractor_util.cpp @@ -15,7 +15,11 @@ #include "extractor_util.h" +#include +#include #include +#include +#include #include "log.h" @@ -62,6 +66,10 @@ bool ExtractorUtil::ExtractFileToPath(const std::string &filePath, const std::st } fileStream.clear(); fileStream.close(); + + int fd = open(filePath.c_str(), O_RDWR, S_IRUSR | S_IWUSR); + fsync(fd); + close(fd); return true; }