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 8c7d2d5d313182c8453236f4906315aa0541e6fe..6422d04001ff54118f3bd9e48ac1530a627a156a 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 4ac98cb00856bd9584f5c833197d02999eea4995..d9a3223ab1aa1fe6ace715c46bacd3e243519d03 100755 --- a/services/bundlemgr_lite/src/extractor_util.cpp +++ b/services/bundlemgr_lite/src/extractor_util.cpp @@ -15,7 +15,12 @@ #include "extractor_util.h" +#include +#include #include +#include +#include +#include #include "log.h" @@ -62,6 +67,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; }