mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-13 11:25:14 +00:00
cgpt_wrapper: Fix non-zero return code when okay
I forgot to reset "ret" to zero in the case the two hashes come out the same. This CL fixes that silly logic bug. BUG=None BRANCH=None TEST=`cgpt show /dev/mtd0` should exit with status 0 Change-Id: I1c64ea215c861c8afb44e235d090c72a5d006d55 Reviewed-on: https://chromium-review.googlesource.com/243325 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Nam Nguyen <namnguyen@chromium.org> Trybot-Ready: Nam Nguyen <namnguyen@chromium.org> Tested-by: Nam Nguyen <namnguyen@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
f620c0d656
commit
9a8dfd00ec
@@ -125,9 +125,10 @@ static int wrap_cgpt(int argc,
|
||||
// Write back "rw_gpt" to NOR flash in two chunks.
|
||||
ret++;
|
||||
modified_hash = DigestFile(rw_gpt_path, SHA1_DIGEST_ALGORITHM);
|
||||
if (original_hash != NULL && modified_hash != NULL &&
|
||||
memcmp(original_hash, modified_hash, SHA1_DIGEST_SIZE) != 0) {
|
||||
if (WriteNorFlash(temp_dir) == 0) {
|
||||
if (original_hash != NULL && modified_hash != NULL) {
|
||||
if (memcmp(original_hash, modified_hash, SHA1_DIGEST_SIZE) != 0) {
|
||||
ret = WriteNorFlash(temp_dir);
|
||||
} else {
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user