}
int ret_app = app_control_get_extra_data(app_control, kAlarmRelativeDelayKey, &delay_string);
- if (APP_CONTROL_ERROR_NONE != ret) {
+ if (APP_CONTROL_ERROR_NONE != ret_app) {
return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR, "Failed to get data.",
("Failed to get data: %d (%s)", ret_app, get_error_message(ret_app)));
}
ret |= chown(newPath.c_str(), fileStat.st_uid, fileStat.st_gid);
if (0 != ret) {
LoggerE("Error while changing ownership/permissions [%s]", GetErrorString(errno).c_str());
- remove(newPath.c_str());
+ if (0 != remove(newPath.c_str())) {
+ LoggerW("Error during rollback [%s], some of copied files may still exist",
+ GetErrorString(errno).c_str());
+ }
error_cb(FilesystemError::Other);
return;
}
if (0 != remove(oldPath.c_str())) {
LoggerE("Error while removing file [%s]", GetErrorString(errno).c_str());
- remove(newPath.c_str());
+ if (0 != remove(newPath.c_str())) {
+ LoggerW("Error during rollback [%s], some of copied files may still exist",
+ GetErrorString(errno).c_str());
+ }
error_cb(FilesystemError::Other);
return;
}