From 0f1de7b5fe7b4dbe12ed544ee7e0ae064393e898 Mon Sep 17 00:00:00 2001 From: Matt Delco Date: Mon, 13 Aug 2018 14:21:04 -0700 Subject: cgpt: show verbose details when primary ignored A later change I authored has the tests check the GUID of the drive. When the primary table is ignored the GUID from the secondary wasn't being displayed either. This change has the details of the secondary table get displayed when the primary table is ignored. BRANCH=none BUG=None TEST=Compiled. The change was runtime tested as part of a larger change though I didn't unit test this particular change after it was split out into a separate commit. Change-Id: I300511cf65c67f4888e08ab49cd72c7acf234507 Signed-off-by: Matt Delco Reviewed-on: https://chromium-review.googlesource.com/1173410 Reviewed-by: Julius Werner --- cgpt/cgpt_show.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cgpt/cgpt_show.c b/cgpt/cgpt_show.c index 72217419..2b882778 100644 --- a/cgpt/cgpt_show.c +++ b/cgpt/cgpt_show.c @@ -328,7 +328,7 @@ static int GptShow(struct drive *drive, CgptShowParams *params) { * 1. in debug mode. * 2. primary table is being ignored * 3. only secondary is valid. - * 4. secondary is not identical to promary. + * 4. secondary is not identical to primary. */ if (params->debug || (drive->gpt.ignored & MASK_PRIMARY) || ((drive->gpt.valid_entries & MASK_SECONDARY) && @@ -349,10 +349,11 @@ static int GptShow(struct drive *drive, CgptShowParams *params) { } /* We show secondary header if any of following is true: * 1. in debug mode. - * 2. only secondary is valid. - * 3. secondary is not synonymous to primary and not ignored. + * 2. primary table is being ignored + * 3. only secondary is valid. + * 4. secondary is not synonymous to primary and not ignored. */ - if (params->debug || + if (params->debug || (drive->gpt.ignored & MASK_PRIMARY) || ((drive->gpt.valid_headers & MASK_SECONDARY) && (!(drive->gpt.valid_headers & MASK_PRIMARY) || !IsSynonymous((GptHeader*)drive->gpt.primary_header, -- cgit v1.2.1