[Prevent] Fixing issue 53026
authorGrzegorz Rynkowski <g.rynkowski@samsung.com>
Fri, 10 May 2013 11:33:59 +0000 (13:33 +0200)
committerGerrit Code Review <gerrit2@kim11>
Tue, 14 May 2013 13:36:22 +0000 (22:36 +0900)
[Issue#] LINUXWRT-305
[Problem] Unchecked return value.
[Cause] N/A
[Solution] Add handling for return value.
[Verification] Build repo.

Change-Id: I180ee55b39978165268823d6d785531ad0ff86a0

src/jobs/widget_install/task_update_files.cpp

index 12af068..1c41e5d 100644 (file)
@@ -68,11 +68,14 @@ void TaskUpdateFiles::StepBackupDirectory()
     LogDebug("StepCreateBackupFolder");
 
     std::string backPath = m_context.locations->getBackupDir();
-    LogDebug("backup resource directory path : " << backPath);
+    LogDebug("Backup resource directory path : " << backPath);
     std::string pkgPath = m_context.locations->getPackageInstallationDir();
 
     if (0 == access(backPath.c_str(), F_OK)) {
-        WrtUtilRemove(backPath);
+        if (!WrtUtilRemove(backPath)) {
+            ThrowMsg(Exceptions::RemovingFolderFailure,
+                    "Error occurs during removing backup resource directory");
+        }
     }
     LogDebug("copy : " << pkgPath << " to " << backPath);
     if ((rename(pkgPath.c_str(), backPath.c_str())) != 0) {