Unmmap all partitions after postinstall
Previous code will only unmap if postinstall finishes
successfully, move call to Unmap() to top of cleanup function.
Test: th
Change-Id: Ibb8b5cd82dbed46da1ed32a3ec370f1acbb42890
diff --git a/payload_consumer/postinstall_runner_action.cc b/payload_consumer/postinstall_runner_action.cc
index 8f2d674..de7848b 100644
--- a/payload_consumer/postinstall_runner_action.cc
+++ b/payload_consumer/postinstall_runner_action.cc
@@ -383,6 +383,11 @@
}
}
+ auto dynamic_control = boot_control_->GetDynamicPartitionControl();
+ CHECK(dynamic_control);
+ dynamic_control->UnmapAllPartitions();
+ LOG(INFO) << "Unmapped all partitions.";
+
ScopedActionCompleter completer(processor_, this);
completer.set_code(error_code);
@@ -401,10 +406,6 @@
if (HasOutputPipe()) {
SetOutputObject(install_plan_);
}
- auto dynamic_control = boot_control_->GetDynamicPartitionControl();
- CHECK(dynamic_control);
- dynamic_control->UnmapAllPartitions();
- LOG(INFO) << "Unmapped all partitions.";
}
void PostinstallRunnerAction::SuspendAction() {
diff --git a/payload_consumer/snapshot_extent_writer.h b/payload_consumer/snapshot_extent_writer.h
index c3c64cd..c3a948e 100644
--- a/payload_consumer/snapshot_extent_writer.h
+++ b/payload_consumer/snapshot_extent_writer.h
@@ -14,6 +14,9 @@
// limitations under the License.
//
+#ifndef UPDATE_ENGINE_SNAPSHOT_EXTENT_WRITER_H_
+#define UPDATE_ENGINE_SNAPSHOT_EXTENT_WRITER_H_
+
#include <cstdint>
#include <vector>
@@ -52,3 +55,5 @@
};
} // namespace chromeos_update_engine
+
+#endif