Make GPT_read() obtain and validate the on-disk MBR itself, via
authorkrw <krw@openbsd.org>
Sun, 18 Jul 2021 15:28:37 +0000 (15:28 +0000)
committerkrw <krw@openbsd.org>
Sun, 18 Jul 2021 15:28:37 +0000 (15:28 +0000)
commitafd1db78ca39561cbd1270abe19b3d19cc6dab55
treeb4701e7174f0585f4f7d649767808aaed2ba214a
parentfec723618f9f2601be12ce5cb0f5d5fea305cd95
Make GPT_read() obtain and validate the on-disk MBR itself, via
MBR_read(), and report success/failure.

Simplifies logic and makes clearer that the protective MBR is a
required part of a GPT.

With the standardization on 0/-1 return values for helper
functions, rename 'valid' to 'error' in GPT_read() to make logic
less mind bending.

No functional change.
sbin/fdisk/fdisk.c
sbin/fdisk/gpt.c
sbin/fdisk/gpt.h
sbin/fdisk/user.c