summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-12-13 02:24:04 +0100
committerGerrit Code Review <noreply-gerritcodereview@google.com>2016-12-13 02:24:04 +0100
commitc908f4f0e33ab84e9be6ce40c58c9a9061fd359e (patch)
tree5d236f4bbe28d90a9876435b957facef6a1b986b
parentMerge "recovery: Remove obsolete code that supports "CACHE:foo" format." (diff)
parentRevert "write_bootloader_message(<options>) should not reset stage field." (diff)
downloadandroid_bootable_recovery-c908f4f0e33ab84e9be6ce40c58c9a9061fd359e.tar
android_bootable_recovery-c908f4f0e33ab84e9be6ce40c58c9a9061fd359e.tar.gz
android_bootable_recovery-c908f4f0e33ab84e9be6ce40c58c9a9061fd359e.tar.bz2
android_bootable_recovery-c908f4f0e33ab84e9be6ce40c58c9a9061fd359e.tar.lz
android_bootable_recovery-c908f4f0e33ab84e9be6ce40c58c9a9061fd359e.tar.xz
android_bootable_recovery-c908f4f0e33ab84e9be6ce40c58c9a9061fd359e.tar.zst
android_bootable_recovery-c908f4f0e33ab84e9be6ce40c58c9a9061fd359e.zip
-rw-r--r--bootloader_message/bootloader_message.cpp8
-rw-r--r--bootloader_message/include/bootloader_message/bootloader_message.h3
2 files changed, 2 insertions, 9 deletions
diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp
index 294b1725d..9a5671843 100644
--- a/bootloader_message/bootloader_message.cpp
+++ b/bootloader_message/bootloader_message.cpp
@@ -164,13 +164,7 @@ bool clear_bootloader_message(std::string* err) {
}
bool write_bootloader_message(const std::vector<std::string>& options, std::string* err) {
- bootloader_message boot;
- if (!read_bootloader_message(&boot, err)) {
- return false;
- }
- // Zero out the entire fields.
- memset(boot.command, 0, sizeof(boot.command));
- memset(boot.recovery, 0, sizeof(boot.recovery));
+ bootloader_message boot = {};
strlcpy(boot.command, "boot-recovery", sizeof(boot.command));
strlcpy(boot.recovery, "recovery\n", sizeof(boot.recovery));
for (const auto& s : options) {
diff --git a/bootloader_message/include/bootloader_message/bootloader_message.h b/bootloader_message/include/bootloader_message/bootloader_message.h
index 437189e32..b3d2182df 100644
--- a/bootloader_message/include/bootloader_message/bootloader_message.h
+++ b/bootloader_message/include/bootloader_message/bootloader_message.h
@@ -193,8 +193,7 @@ bool write_bootloader_message(const bootloader_message& boot, std::string* err);
bool write_bootloader_message_to(const bootloader_message& boot,
const std::string& misc_blk_device, std::string* err);
-// Write bootloader message (boots into recovery with the options) to BCB. Will
-// set command and recovery fields only.
+// Write bootloader message (boots into recovery with the options) to BCB.
bool write_bootloader_message(const std::vector<std::string>& options, std::string* err);
// Clear BCB.