Fix Remove function in file utils 38/240838/1
authorIlho Kim <ilho159.kim@samsung.com>
Wed, 12 Aug 2020 04:59:00 +0000 (13:59 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Wed, 12 Aug 2020 04:59:00 +0000 (13:59 +0900)
If the path is not exists Remove function should return true

Change-Id: Ib05529a4131d8afaa7ea192064bbfa04d7279db9
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/utils/file_util.cc

index 3740c82..60295cb 100644 (file)
@@ -332,15 +332,8 @@ bool RemoveAll(const bf::path& path) {
 
 bool Remove(const bf::path& path) {
   bs::error_code error;
-  if (!exists(path, error)) {
-    if (error) {
-      LOG(ERROR) << "Cannot remove: " << path << ", " << error.message();
-      return false;
-    }
-
-    if (!bf::is_symlink(bf::symlink_status(path, error)))
-      return true;
-  }
+  if (!exists(bf::symlink_status(path, error)))
+    return true;
 
   bf::remove(path, error);
   if (error) {