Fix Remove function in file_utils 21/240721/2
authorIlho Kim <ilho159.kim@samsung.com>
Tue, 11 Aug 2020 02:15:41 +0000 (11:15 +0900)
committerilho kim <ilho159.kim@samsung.com>
Tue, 11 Aug 2020 06:53:07 +0000 (06:53 +0000)
Change-Id: I343fe3ebd842d907334a0630eb0308c3c30db60e
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/utils/file_util.cc

index 671deb8..3740c82 100644 (file)
@@ -337,10 +337,10 @@ bool Remove(const bf::path& path) {
       LOG(ERROR) << "Cannot remove: " << path << ", " << error.message();
       return false;
     }
-    return true;
+
+    if (!bf::is_symlink(bf::symlink_status(path, error)))
+      return true;
   }
-  if (!bf::is_symlink(bf::symlink_status(path)))
-    return true;
 
   bf::remove(path, error);
   if (error) {