diff options
author | Weiping Zhang <zhangweiping@didichuxing.com> | 2018-06-21 23:47:10 +0800 |
---|---|---|
committer | Weiping Zhang <zhangweiping@didichuxing.com> | 2018-06-22 01:19:13 +0800 |
commit | c41db9e6908d3b756efd47534720c7da095abd19 (patch) | |
tree | ff0018da5a7f06a9cca50ba439d4e43ba1341b07 /gpt.cc | |
parent | 5e490b279f313bf2138d99a12f3fbed299d4ac2e (diff) | |
download | sgdisk-c41db9e6908d3b756efd47534720c7da095abd19.tar.gz |
load main partition table if main header crc is ok
mainCrcOk and secondCrcOk were overwritten by header rebuilding.
Signed-off-by: Weiping Zhang <zhangweiping@didichuxing.com>
Diffstat (limited to 'gpt.cc')
-rw-r--r-- | gpt.cc | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -899,9 +899,8 @@ int GPTData::ForceLoadGPTData(void) { } // if/else/if // Figure out which partition table to load.... - // Load the main partition table, since either its header's CRC is OK or the - // backup header's CRC is not OK.... - if (mainCrcOk || !secondCrcOk) { + // Load the main partition table, if its header's CRC is OK + if (validHeaders != 2) { if (LoadMainTable() == 0) allOK = 0; } else { // bad main header CRC and backup header CRC is OK |