From b4317876c0fde18718b20793bf769a766d0b7c52 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 23 Apr 2022 14:39:17 +0000 Subject: Add missing uuid_dec_le() to init_gp() so -A works on big-endian architectures too. --- sbin/fdisk/gpt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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])); } -- cgit v1.2.3