summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2022-05-10 00:56:28 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2022-05-10 00:56:28 +0000
commitff246bf727ea35fa8ed9d9d125c7c722123f935a (patch)
tree9d6ff1e9e7764a8fb45af6ad1952bbba1113e2df
parent56d048d637a36ffe4008469e390ad1a3d769eca1 (diff)
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.
-rw-r--r--sbin/fdisk/gpt.c7
1 files 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 <mmu@grummel.net>
* Copyright (c) 2015 Kenneth R Westerback <krw@openbsd.org>
@@ -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: