Fix StepConvertXml 14/202314/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 27 Mar 2019 05:31:04 +0000 (14:31 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Wed, 27 Mar 2019 05:31:04 +0000 (14:31 +0900)
- Fail log will be printed only when remove has failed.

Change-Id: Ia91bd07f4b14a2e4213a93303a549a7b13becd53
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/tpk/step/pkgmgr/step_convert_xml.cc

index f62e71c..20a399a 100644 (file)
@@ -132,8 +132,9 @@ common_installer::Step::Status StepConvertXml::clean() {
   if (!backup_path_.empty()) {
     bs::error_code error;
     bf::remove(backup_path_, error);
-    LOG(WARNING) << "Failed to remove backup file " << backup_path_
-                 << " due to error: " << error;
+    if (error)
+      LOG(WARNING) << "Failed to remove backup file " << backup_path_
+                   << " due to error: " << error;
   }
 
   return Step::Status::OK;