diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2022-04-25 13:07:54 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2022-04-25 13:07:54 +0000 |
commit | 2ffbdc7e0261695df4345b73134a89074b5aab74 (patch) | |
tree | bcfe94bb786e4438c0bc23b4ce8b68d00c4c7311 | |
parent | 12c8f9c222eb973e63c5e4f55ca6c4a5d44fcab0 (diff) |
gh_csum an gh_part_csum are not used between initializing
the GPT and calculating them when writing the GPT to disk.
No need to update them in add_partition().
Pointed out by jmatthew@
-rw-r--r-- | sbin/fdisk/gpt.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c index 9e2b8fe93fd..608e2828204 100644 --- a/sbin/fdisk/gpt.c +++ b/sbin/fdisk/gpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.c,v 1.73 2022/04/23 14:39:16 krw Exp $ */ +/* $OpenBSD: gpt.c,v 1.74 2022/04/25 13:07:53 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller <mmu@grummel.net> * Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org> @@ -472,7 +472,7 @@ add_partition(const uint8_t *beuuid, const char *name, uint64_t sectors) { struct uuid uuid, gp_type; int rslt; - uint64_t end, freesectors, gpbytes, start; + uint64_t end, freesectors, start; uint32_t status, pn; uuid_dec_be(beuuid, &uuid); @@ -514,10 +514,6 @@ add_partition(const uint8_t *beuuid, const char *name, uint64_t sectors) goto done; uuid_enc_le(&gp[pn].gp_guid, &uuid); - gpbytes = gh.gh_part_num * gh.gh_part_size; - gh.gh_part_csum = crc32((unsigned char *)&gp, gpbytes); - gh.gh_csum = 0; - gh.gh_csum = crc32((unsigned char *)&gh, gh.gh_size); return 0; |