Modify the bf::exists function to check error.value (#275) accepted/tizen/unified/20200907.144053 submit/tizen/20200901.065247
author최종헌/Common Platform Lab(SR)/Engineer/삼성전자 <j-h.choi@samsung.com>
Thu, 3 Sep 2020 22:30:31 +0000 (07:30 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Thu, 3 Sep 2020 22:30:31 +0000 (07:30 +0900)
Change-Id: I2dc642bfd18c8d3ddb476fcb086f6e6519d8bc7c

NativeLauncher/util/utils.cc

index d6ba2de..bb1ea62 100644 (file)
@@ -475,12 +475,13 @@ static bool copyOwnershipAndPermissions(const bf::path& path, const bf::path& pa
 bool exist(const bf::path& path)
 {
        bs::error_code error;
-       bf::exists(path, error);
+       int ret = bf::exists(path, error);
        if (error) {
-               _ERR("Failed to check %s exists : %s", path.c_str(), error.message().c_str());
-               return false;
+               if ((error.value() != bs::errc::success) && (error.value() != bs::errc::no_such_file_or_directory)) {
+                       _ERR("Failed to check %s exists : %s", path.c_str(), error.message().c_str());
+               }
        }
-       return true;
+       return ret;
 }
 
 bool createDir(const bf::path& path)