From: 최종헌/Common Platform Lab(SR)/Engineer/삼성전자 Date: Thu, 3 Sep 2020 22:30:31 +0000 (+0900) Subject: Modify the bf::exists function to check error.value (#275) X-Git-Tag: accepted/tizen/unified/20200907.144053^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d0e47a5dd913225b5ccd5af1fed87371d8e35588;p=platform%2Fcore%2Fdotnet%2Flauncher.git Modify the bf::exists function to check error.value (#275) Change-Id: I2dc642bfd18c8d3ddb476fcb086f6e6519d8bc7c --- diff --git a/NativeLauncher/util/utils.cc b/NativeLauncher/util/utils.cc index d6ba2de..bb1ea62 100644 --- a/NativeLauncher/util/utils.cc +++ b/NativeLauncher/util/utils.cc @@ -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)