- Recovery file creation process is separated with
file creation and type write processes.
- Integrate those two processes into one.
Change-Id: I9c5e0b192c8f35d7a612e58417bed1d9468bfd87
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
}
} else {
// create file
- FILE* handle = fopen(path.c_str(), "w");
- if (!handle) {
+ if (!WriteAndCommitFileContent()) {
path_.clear();
return;
}
- fclose(handle);
LOG(DEBUG) << "Recovery file " << path_ << " created";
}
}
LOG(ERROR) << "Failed to create recovery file";
return Status::CONFIG_ERROR;
}
- recovery_file->set_type(context_->request_type.get());
-
- if (!recovery_file->WriteAndCommitFileContent()) {
- LOG(ERROR) << "Failed to write recovery file";
- return Status::CONFIG_ERROR;
- }
context_->recovery_info.set(RecoveryInfo(std::move(recovery_file)));
return Status::OK;