#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>
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();