Handle errors on partition close
We flush in memory data to disk when PartitionWriter::Close() is called,
currently errors reported in this method are ignored by DeltaPerformer.
Fix by propagating the errors upwards and report an OTA failure.
Test: th
Bug: 315973255
Change-Id: I9c55cf291c0e14868be79a36f7e89b27ed9662dc
diff --git a/payload_consumer/vabc_partition_writer.cc b/payload_consumer/vabc_partition_writer.cc
index bcaccce..b4f97d2 100644
--- a/payload_consumer/vabc_partition_writer.cc
+++ b/payload_consumer/vabc_partition_writer.cc
@@ -401,7 +401,9 @@
if (cow_writer_) {
LOG(INFO) << "Finalizing " << partition_update_.partition_name()
<< " COW image";
- cow_writer_->Finalize();
+ if (!cow_writer_->Finalize()) {
+ return -errno;
+ }
cow_writer_ = nullptr;
}
return 0;