[Release] wrt-installer_0.0.73
[framework/web/wrt-installer.git] / src / jobs / widget_install / task_recovery.cpp
index 6ff2218..1b922db 100644 (file)
@@ -34,7 +34,6 @@
 #include <dpl/foreach.h>
 
 #include <dpl/wrt-dao-ro/widget_config.h>
-#include <dpl/utils/file_utils.h>
 #include <dpl/utils/wrt_utility.h>
 #include <widget_install/job_widget_install.h>
 #include <widget_install/widget_install_context.h>
@@ -64,7 +63,10 @@ void TaskRecovery::StepCreateCheckFile()
     FILE *temp = fopen(infoPath.str().c_str(), "w+");
     if (temp != NULL) {
         fputs(m_context.locations->getWidgetSource().c_str(), temp);
-        fsync(temp->_fileno);
+        if (-1 == fsync(temp->_fileno)) {
+            fclose(temp);
+            ThrowMsg(Exceptions::InternalError, "Fail to fsync for recovery.");
+        }
         fclose(temp);
 
         m_context.installInfo = infoPath.str();