[Prevent] Handle return value.
authorJan Olszak <j.olszak@samsung.com>
Tue, 20 Nov 2012 07:07:08 +0000 (08:07 +0100)
committerJan Olszak <j.olszak@samsung.com>
Tue, 20 Nov 2012 07:07:08 +0000 (08:07 +0100)
[Issue#] Unhandled return value.
[Bug] N/A
[Cause] N/A
[Solution] Logging on error.
[Verification] Build installer

Change-Id: Ic2609d79d9c82039e94a899fccec5539712fe1c9

src/jobs/widget_install/task_database.cpp
src/jobs/widget_uninstall/task_remove_files.cpp

index 450de41..3054c08 100644 (file)
@@ -35,6 +35,8 @@
 #include <sstream>
 #include <ace_api_install.h>
 #include <ace_registration.h>
+#include <errno.h>
+#include <string.h>
 
 using namespace WrtDB;
 
index 2dfe92e..7a8f66b 100644 (file)
@@ -29,6 +29,8 @@
 #include <dpl/utils/wrt_utility.h>
 #include <ail.h>
 #include <pkgmgr/pkgmgr_parser.h>
+#include <errno.h>
+#include <string.h>
 
 namespace Jobs {
 namespace WidgetUninstall {
@@ -138,7 +140,10 @@ void TaskRemoveFiles::StepRemoveExternalLocations()
         if(WrtUtilFileExists(*path))
         {
             LogDebug("  -> " << *path);
-            remove(path->c_str());
+            int ret = remove(path->c_str());
+            if (ret != 0) {
+                LogDebug("Failed to remove the file: " << path->c_str() << " with error: " << strerror(errno));
+            }
         }
         else if(WrtUtilDirExists(*path))
         {