From 26d5ae741efd904fdc20187eddad33ca31dd64fa Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 13 Dec 2016 01:06:24 +0000 Subject: [PATCH] Revert "write_bootloader_message() should not reset stage field." This reverts commit 7e31f421a514da09b90e46dbd642a5e9b16e0003. Bug: 33534933 Change-Id: Ib173f6b1e36a79deafc3592785195693a6779471 --- bootloader_message/bootloader_message.cpp | 8 +------- .../include/bootloader_message/bootloader_message.h | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp index 294b1725..9a567184 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& 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 422e87d9..e45f4248 100644 --- a/bootloader_message/include/bootloader_message/bootloader_message.h +++ b/bootloader_message/include/bootloader_message/bootloader_message.h @@ -192,8 +192,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& options, std::string* err); // Clear BCB.