From 42cf3a9b7e783ddd5f0f20629c8e1badb1f87b73 Mon Sep 17 00:00:00 2001 From: krw Date: Tue, 10 May 2022 00:56:27 +0000 Subject: [PATCH] Align fdisk with the logic used in the kernel and allow the protective EFI GPT partition to be in MBR partitions 0-3, not just the default partition 0. --- sbin/fdisk/gpt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c index bbd1d37e8b8..517ff006fca 100644 --- a/sbin/fdisk/gpt.c +++ b/sbin/fdisk/gpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.c,v 1.77 2022/05/06 23:53:43 krw Exp $ */ +/* $OpenBSD: gpt.c,v 1.78 2022/05/10 00:56:27 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller * Copyright (c) 2015 Kenneth R Westerback @@ -312,10 +312,11 @@ GPT_read(const int which) int error; error = MBR_read(0, 0, &gmbr); - if (error == 0) - error = protective_mbr(&gmbr); if (error) goto done; + error = protective_mbr(&gmbr); + if (error == -1) + goto done; switch (which) { case PRIMARYGPT: -- 2.20.1