From: krw Date: Sat, 23 Apr 2022 14:39:16 +0000 (+0000) Subject: Add missing uuid_dec_le() to init_gp() so -A works on X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1f7356e9e63c38be8c07acf514dfcfba7842f299;p=openbsd Add missing uuid_dec_le() to init_gp() so -A works on big-endian architectures too. --- diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c index 315e45bb819..9e2b8fe93fd 100644 --- a/sbin/fdisk/gpt.c +++ b/sbin/fdisk/gpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.c,v 1.72 2022/04/20 23:36:30 krw Exp $ */ +/* $OpenBSD: gpt.c,v 1.73 2022/04/23 14:39:16 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller * Copyright (c) 2015 Kenneth R Westerback @@ -578,6 +578,7 @@ int init_gp(const int how) { struct gpt_partition oldgp[NGPTPARTITIONS]; + struct uuid gp_type; const uint8_t gpt_uuid_efi_system[] = GPT_UUID_EFI_SYSTEM; const uint8_t gpt_uuid_openbsd[] = GPT_UUID_OPENBSD; uint64_t prt_ns; @@ -588,7 +589,8 @@ init_gp(const int how) memset(&gp, 0, sizeof(gp)); else { for (pn = 0; pn < gh.gh_part_num; pn++) { - if (PRT_protected_guid(&gp[pn].gp_type)) + uuid_dec_le(&gp[pn].gp_type, &gp_type); + if (PRT_protected_guid(&gp_type)) continue; memset(&gp[pn], 0, sizeof(gp[pn])); }